Browse Source

Merge branch 'develop_yh6' of jianguan-web/jg-ocs-html into pre-release

李磊 2 years ago
parent
commit
656570595d
88 changed files with 4171 additions and 639 deletions
  1. 1 1
      public/version.json
  2. 9 0
      src/api/allocateBill.js
  3. 3 2
      src/api/allocateReturn.js
  4. 16 0
      src/api/allocateType.js
  5. 1 3
      src/api/checkWarehouse.js
  6. 8 1
      src/api/expenseManagement.js
  7. 27 0
      src/api/financeBook.js
  8. 73 0
      src/api/product.js
  9. 59 0
      src/api/reportData.js
  10. 9 0
      src/api/salesBillReport.js
  11. 13 0
      src/api/salesDetail.js
  12. 13 10
      src/api/salesReturn.js
  13. 3 0
      src/components/index.less
  14. 1 1
      src/components/newThem.less
  15. 75 0
      src/config/router.config.js
  16. 23 2
      src/libs/JGPrint.js
  17. 3 0
      src/utils/mixin.js
  18. 6 15
      src/views/allocationManagement/matchSendOutOrder/list.vue
  19. 137 82
      src/views/allocationManagement/transferOut/basicInfoModal.vue
  20. 36 21
      src/views/allocationManagement/transferOut/detail.vue
  21. 190 90
      src/views/allocationManagement/transferOut/edit.vue
  22. 29 8
      src/views/allocationManagement/transferOut/list.vue
  23. 39 33
      src/views/allocationManagement/transferOut/printModal.vue
  24. 24 21
      src/views/allocationManagement/transferReturn/basicInfoModal.vue
  25. 9 1
      src/views/allocationManagement/transferReturn/detail.vue
  26. 22 6
      src/views/allocationManagement/transferReturn/edit.vue
  27. 22 4
      src/views/allocationManagement/transferReturn/editGrp.vue
  28. 25 4
      src/views/allocationManagement/transferReturn/list.vue
  29. 4 0
      src/views/allocationManagement/transferReturn/print.vue
  30. 14 2
      src/views/allocationManagement/transferReturn/printModal.vue
  31. 1 10
      src/views/allocationManagement/transfersPrint/list.vue
  32. 15 9
      src/views/basicData/transferTypeManagement/editModal.vue
  33. 3 2
      src/views/basicData/transferTypeManagement/list.vue
  34. 54 17
      src/views/common/allocateType.js
  35. 72 0
      src/views/common/allocateTypeByLevel.js
  36. 16 8
      src/views/common/custList.vue
  37. 73 0
      src/views/common/expenseType.js
  38. 78 0
      src/views/common/months.js
  39. 6 2
      src/views/common/productBrand.js
  40. 39 2
      src/views/common/productType.js
  41. 10 1
      src/views/common/productTypeAll.js
  42. 40 7
      src/views/expenseManagement/expenseReimbursement/add.vue
  43. 26 7
      src/views/expenseManagement/expenseReimbursement/baseDataModal.vue
  44. 1 1
      src/views/expenseManagement/expenseReimbursement/department.js
  45. 1 1
      src/views/expenseManagement/expenseReimbursement/detail.vue
  46. 23 7
      src/views/expenseManagement/expenseReimbursement/epenseDetailModal.vue
  47. 1 1
      src/views/expenseManagement/expenseReimbursement/importGuideModal.vue
  48. 22 7
      src/views/expenseManagement/expenseReimbursement/list.vue
  49. 17 7
      src/views/expenseManagement/expenseReimbursement/productInfoModal.vue
  50. 22 9
      src/views/expenseManagement/expenseReimbursementDetail/list.vue
  51. 73 20
      src/views/financialManagement/collectionDetailStatic/list.vue
  52. 12 7
      src/views/financialManagement/financialCollection/detail.vue
  53. 13 8
      src/views/financialManagement/financialCollection/edit.vue
  54. 143 39
      src/views/financialManagement/financialCollection/fcDetailModal.vue
  55. 1 1
      src/views/financialManagement/financialCollection/fcDetailSxItem.vue
  56. 40 15
      src/views/financialManagement/financialCollection/list.vue
  57. 5 4
      src/views/inventoryManagement/inventoryQuery/list.vue
  58. 14 25
      src/views/inventoryManagement/makeInventory/check.vue
  59. 129 0
      src/views/inventoryManagement/makeInventory/printModal.vue
  60. 14 25
      src/views/inventoryManagement/supervisionDisk/check.vue
  61. 104 0
      src/views/productManagement/shelfNoManage/changeRecordModal.vue
  62. 189 0
      src/views/productManagement/shelfNoManage/chooseImportModal.vue
  63. 148 0
      src/views/productManagement/shelfNoManage/editHwModal.vue
  64. 195 0
      src/views/productManagement/shelfNoManage/importGuideModal.vue
  65. 312 0
      src/views/productManagement/shelfNoManage/list.vue
  66. 26 9
      src/views/reportData/allocationDetails/list.vue
  67. 16 12
      src/views/reportData/allocationOrderTotal/list.vue
  68. 327 0
      src/views/reportData/expenseAccountReport/bearerList.vue
  69. 299 0
      src/views/reportData/expenseAccountReport/categoryList.vue
  70. 192 0
      src/views/reportData/expenseAccountReport/selectMonth.vue
  71. 19 12
      src/views/reportData/warehousingOrder/list.vue
  72. 7 3
      src/views/salesManagement/pushOrderManagement/detail.vue
  73. 1 1
      src/views/salesManagement/pushOrderManagement/list.vue
  74. 18 4
      src/views/salesManagement/pushOrderManagement/sendTypeModal.vue
  75. 6 2
      src/views/salesManagement/receiptPrint/list.vue
  76. 9 3
      src/views/salesManagement/receiptPrint/printModel.vue
  77. 29 11
      src/views/salesManagement/salesQuery/detail.vue
  78. 29 1
      src/views/salesManagement/salesQuery/list.vue
  79. 32 6
      src/views/salesManagement/salesQuery/printModal.vue
  80. 118 0
      src/views/salesManagement/salesQuery/stockOutDetailModal.vue
  81. 4 0
      src/views/salesManagement/stockPrint/list.vue
  82. 29 3
      src/views/salesReturnManagement/salesReturn/chooseDepartUserModal.vue
  83. 26 8
      src/views/salesReturnManagement/salesReturn/detail.vue
  84. 1 1
      src/views/salesReturnManagement/salesReturn/importGuideModal.vue
  85. 32 11
      src/views/salesReturnManagement/salesReturn/list.vue
  86. 142 0
      src/views/salesReturnManagement/salesReturn/printModal.vue
  87. 1 1
      src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue
  88. 2 2
      vue.config.js

+ 1 - 1
public/version.json

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

+ 9 - 0
src/api/allocateBill.js

@@ -22,6 +22,15 @@ export const allocDetailQueryPageForReturn = (params) => {
     method: 'post'
   })
 }
+
+// 批量修改部门信息
+export const updateBatchDepartment = params => {
+  return axios({
+    url: '/allocateBill/detail/updateBatchDepartment',
+    data: params,
+    method: 'post'
+  })
+}
 // 调拨管理  新增
 export const allocateBillSave = params => {
   return axios({

+ 3 - 2
src/api/allocateReturn.js

@@ -42,8 +42,9 @@ export const allocateReturnExcel = params => {
 // 打印
 export const allocateReturnPrint = params => {
   return axios({
-    url: `/allocateReturn/print/${params.allocateReturnSn}/${params.printType}`,
-    method: 'get',
+    url: `/allocateReturn/print/${params.printType}`,
+    method: 'post',
+    data: params,
     responseType: 'blob'
   })
 }

+ 16 - 0
src/api/allocateType.js

@@ -19,6 +19,22 @@ export const allocateTypeAllList = params => {
     method: 'post'
   })
 }
+// 调拨类型 树列表
+export const allocateTypeTreeList = params => {
+  return axios({
+    url: '/allocateType/queryTreeList',
+    data: params,
+    method: 'post'
+  })
+}
+// 根据级别查询
+export const queryListByTreeLevel = params => {
+  return axios({
+    url: '/allocateType/queryListByTreeLevel',
+    data: params,
+    method: 'post'
+  })
+}
 // 调拨类型管理  新增/编辑
 export const allocateTypeSave = params => {
   return axios({

+ 1 - 3
src/api/checkWarehouse.js

@@ -47,9 +47,7 @@ export const checkWarehouseDetailCount = (params) => {
 }
 // 盘点人盘点/监盘人监盘 盘点  打印
 export const checkWarehouseDetailPrint = params => {
-  const url = `/checkWarehouse/detail/print/${params.checkWarehouseSn}/${params.type}`
-  delete params.checkWarehouseSn
-  delete params.type
+  const url = `/checkWarehouse/detail/print/${params.printType}`
   return axios.request({
     url: url,
     data: params,

+ 8 - 1
src/api/expenseManagement.js

@@ -111,7 +111,14 @@ export const expenseAcctDetailSave = (params) => {
     method: 'post'
   })
 }
-
+// 费用类型
+export const expenseTypeList = (params) => {
+  return axios({
+    url: `/expenseType/queryTreeList`,
+    data: params,
+    method: 'post'
+  })
+}
 // 导入费用报销明细
 export const expenseImportDetail = (params) => {
   return axios({

+ 27 - 0
src/api/financeBook.js

@@ -12,6 +12,15 @@ export const financeBookQueryPage = (params) => {
   })
 }
 
+// 统计
+export const financeBookQueryCount = (params) => {
+  return axios({
+    url: `/financeBook/queryCount`,
+    data: params,
+    method: 'post'
+  })
+}
+
 // 财务收款明细-分页列表
 export const financeBookDetailQueryPage = (params) => {
   const url = `/report/financeBook/detail/queryPage/${params.pageNo}/${params.pageSize}`
@@ -23,6 +32,14 @@ export const financeBookDetailQueryPage = (params) => {
     method: 'post'
   })
 }
+// 财务收款明细-统计
+export const financeBookReportDetailCount = (params) => {
+  return axios({
+    url: `/report/financeBook/detail/queryCount`,
+    data: params,
+    method: 'post'
+  })
+}
 
 // 财务收款明细-导出
 export const financeBookDetailExport = (params) => {
@@ -81,6 +98,16 @@ export const financeBookSave = (params) => {
   })
 }
 
+// 查询账户信息
+export const lastPayerAccountInfo = (params) => {
+  const url = `/financeBook/detail/lastPayerAccountInfo`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
 // 提交
 export const financeBookSubmit = (params) => {
   const url = `/financeBook/submit`

+ 73 - 0
src/api/product.js

@@ -329,4 +329,77 @@ export const queryNewProductPage = (params) => {
     data: params,
     method: 'post'
   })
+}
+
+// 导出产品及货位信息
+export const stackPlaceExport = (params) => {
+  return axios({
+    url: '/product/stackPlace/export',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 导入产品货位-导出错误
+export const stackPlaceExportError = (params) => {
+  return axios({
+    url: '/product/stackPlace/exportImportError',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 导入产品货位
+export const stackPlaceImport = (params) => {
+  return axios({
+    url: '/product/stackPlace/import',
+    data: params,
+    method: 'post'
+  })
+}
+// 下载导入模板
+export const stackPlaceImportTemplate= (params) => {
+  return axios({
+    url: '/product/stackPlace/importTemplate',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 导入产品货位-入库数据
+export const stackPlaceInsertImport = (params) => {
+  return axios({
+    url: '/product/stackPlace/insertImport',
+    data: params,
+    method: 'post'
+  })
+}
+// 查询产品货位历史变更记录
+export const stackPlaceListHistory = (params) => {
+  return axios({
+    url: '/product/stackPlace/listHistoryByProductSn',
+    data: params,
+    method: 'post'
+  })
+}
+// 分页查询产品及货位信息
+export const queryStackPlaceQueryPage = (params) => {
+  const url = `/product/stackPlace/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 保存产品货位信息
+export const stackPlaceSave = (params) => {
+  return axios({
+    url: '/product/stackPlace/save',
+    data: params,
+    method: 'post'
+  })
 }

+ 59 - 0
src/api/reportData.js

@@ -519,4 +519,63 @@ export const allocateReturnReportDetailExport = (params) => {
     method: 'post',
     responseType: 'blob'
   })
+}
+// 费用统计按承担方分页
+export const expenseCollectReportQueryPageByTarget = (params) => {
+  const url = `/report/expenseCollectReport/queryPageByTarget/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 费用统计按承担方汇总合计
+export const expenseCollectReportQueryCountByTarget = (params) => {
+  const url = `/report/expenseCollectReport/queryCountByTarget`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 导出费用统计按承担方
+export const expenseCollectReportExportByTarget = (params) => {
+  return axios({
+    url: '/report/expenseCollectReport/exportByTarget',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 费用统计按品类分页
+export const expenseCollectReportQueryPageByProductType = (params) => {
+  const url = `/report/expenseCollectReport/queryPageByProductType/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 费用统计按品类汇总合计
+export const expenseCollectReportQueryCountByProductType = (params) => {
+  const url = `/report/expenseCollectReport/queryCountByProductType`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 导出费用统计按品类
+export const expenseCollectReportExportByProductType = (params) => {
+  return axios({
+    url: '/report/expenseCollectReport/exportByProductType',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
 }

+ 9 - 0
src/api/salesBillReport.js

@@ -1,5 +1,14 @@
 import { axios } from '@/utils/request'
 
+// 销售明细导出报表
+export const salesDetailExport = (params) => {
+  return axios({
+    url: '/report/salesBillReport/salesDetail',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
 //  开单销售单报表   列表  有分页
 export const salesBillReportList = (params) => {
   const url = `/report/salesBillReport/queryPage/${params.pageNo}/${params.pageSize}`

+ 13 - 0
src/api/salesDetail.js

@@ -80,6 +80,19 @@ export const salesDetailAllStockList = (params) => {
     method: 'post'
   })
 }
+
+// 缺货明细
+export const salesStockoutDetail = (params) => {
+  const url = `/sales/detail/queryPageStock`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
 // 销售列表  分页  带库存
 export const salesDetailStockList = (params) => {
   const url = `/sales/detail/queryPageStock/${params.pageNo}/${params.pageSize}`

+ 13 - 10
src/api/salesReturn.js

@@ -63,8 +63,9 @@ export const salesReturnPay = (params) => {
 //  销售退货 打印预览
 export const salesReturnPrint = (params) => {
   return axios.request({
-    url: `/salesReturn/print/${params.sn}/${params.status}`,
-    method: 'get',
+    url: `/salesReturn/print/${params.priceType}`,
+    data: params,
+    method: 'post',
     responseType: 'blob'
   })
 }
@@ -72,24 +73,26 @@ export const salesReturnPrint = (params) => {
 //  销售退货 导出
 export const salesReturnExport = (params) => {
   return axios.request({
-    url: `/salesReturn/export/${params.sn}/${params.status}`,
+    url: `/salesReturn/export/${params.salesReturnBillSn}/${params.priceType}`,
     method: 'get',
     responseType: 'blob'
   })
 }
 
-//  销售退货 统计查询
-export const salesReturnQueryCount = (params) => {
+//  销售退货 分页查询产品
+export const salesReturnList = (params) => {
+  const url = `/salesReturn/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios({
-    url: '/salesReturn/queryCount',
+    url: url,
     data: params,
     method: 'post'
   })
 }
-
-//  销售退货 分页查询产品
-export const salesReturnList = (params) => {
-  const url = `/salesReturn/queryPage/${params.pageNo}/${params.pageSize}`
+// 销售退货 统计
+export const salesReturnQueryCount = (params) => {
+  const url = `/salesReturn/queryCount`
   delete params.pageNo
   delete params.pageSize
   return axios({

+ 3 - 0
src/components/index.less

@@ -350,4 +350,7 @@
 }
 .ant-alert-message, .ant-card-head{
   color: #000000!important;
+}
+.ant-select-disabled .ant-select-selection,.ant-cascader-picker-disabled{
+  color: #999!important;
 }

+ 1 - 1
src/components/newThem.less

@@ -7,4 +7,4 @@
 @collapse-header-padding: 6px 8px;
 @table-padding-vertical: 5px;
 @table-padding-horizontal: 5px;
-@input-disabled-bg: #dedede;
+@input-disabled-bg: #fdfdfd;

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

@@ -2053,6 +2053,56 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/reportData/expenseAccountBearerReport',
+            redirect: '/reportData/expenseAccountBearerReport/list',
+            name: 'expenseAccountBearerReport',
+            component: BlankLayout,
+            meta: {
+              title: '费用汇总报表(按承担方)',
+              icon: 'profile',
+              permission: 'M_expenseAccountBearerReportList1'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'expenseAccountBearerReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/expenseAccountReport/bearerList.vue'),
+                meta: {
+                  title: '费用汇总报表(按承担方)',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_expenseAccountBearerReportList'
+                }
+              }
+            ]
+          },
+          {
+            path: '/reportData/expenseAccountCategoryReport',
+            redirect: '/reportData/expenseAccountCategoryReport/list',
+            name: 'expenseAccountCategoryReport',
+            component: BlankLayout,
+            meta: {
+              title: '费用汇总报表(按品类)',
+              icon: 'profile',
+              permission: 'M_expenseAccountCategoryReportList1'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'expenseAccountCategoryReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/expenseAccountReport/categoryList.vue'),
+                meta: {
+                  title: '费用汇总报表(按品类)',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_expenseAccountCategoryReportList'
+                }
+              }
+            ]
           }
           // {
           //   path: '/reportData/allCountryCostReport',
@@ -2401,6 +2451,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/productManagement/shelfNoManage',
+            redirect: '/productManagement/shelfNoManage/list',
+            name: 'shelfNoManage',
+            component: BlankLayout,
+            meta: {
+              title: '货位编号管理',
+              icon: 'radar-chart',
+              permission: 'M_shelfNoManageList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'shelfNoManageList',
+                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/shelfNoManage/list.vue'),
+                meta: {
+                  title: '货位编号管理',
+                  icon: 'radar-chart',
+                  hidden: true,
+                  permission: 'M_shelfNoManageList'
+                }
+              }
+            ]
           }
         ]
       },

+ 23 - 2
src/libs/JGPrint.js

@@ -135,7 +135,23 @@ export const jGPrint = function (data, type, callback, printLogParams,printPageS
       LODOP.PRINTA()
     }
 }
-
+// 浏览器打印pdf功能
+export const winPrintPdf = function(data,type,callback){
+  if (!data) {
+    return
+  }
+  const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
+  document.getElementById('print').innerHTML = '<iframe id="printfbod" name="printfbod" src="' + url + '" hidden></iframe>'
+  window.frames['printfbod'].onload = function(){
+    callback()
+  }
+  if(type == 'orginPrint'){
+    window.frames['printfbod'].focus()
+    window.frames['printfbod'].print()
+  }else{
+    window.open(url)
+  }
+}
 // 打印
 export const printFun = function(url,params,type,taskName,callback,printLogParams,hidePrint){
   url(params).then(res => {
@@ -151,7 +167,12 @@ export const printFun = function(url,params,type,taskName,callback,printLogParam
       reader.readAsText(res)
     } else {
        console.log(res,'printFun')
-       jGPrintPdf(res,type,taskName,printLogParams,callback,hidePrint)
+       // 使用浏览器自带打印功能
+       if(type == 'orginPrint'||type=='orginPreview'){
+         winPrintPdf(res,type,callback)
+       }else{
+         jGPrintPdf(res,type,taskName,printLogParams,callback,hidePrint)
+       }
     }
   })
 }

+ 3 - 0
src/utils/mixin.js

@@ -86,6 +86,9 @@ const commonMixin = {
         if (this.spinning !== undefined) {
           this.spinning = a
         }
+        if (this.exportLoading !== undefined){
+          this.exportLoading = a
+        }
       }
     }
   },

+ 6 - 15
src/views/allocationManagement/matchSendOutOrder/list.vue

@@ -16,16 +16,11 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨类型">
-                <AllocateType id="allocateBillList-allocateTypeSn" v-model="queryParam.allocateTypeSn"></AllocateType>
+              <a-form-item label="收货客户名称">
+                <dealerSubareaScopeList ref="receiverSn" defValKey="buyerSn" @change="custChange" v-model="queryParam.receiverSn" />
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
-                <a-form-item label="收货客户名称">
-                  <dealerSubareaScopeList ref="receiverSn" defValKey="buyerSn" @change="custChange" v-model="queryParam.receiverSn" />
-                </a-form-item>
-              </a-col>
               <a-col :md="4" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
@@ -108,11 +103,10 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import { allocateBillList, allocateBillCheck } from '@/api/allocateBill'
-import AllocateType from '@/views/common/allocateType.js'
 export default {
   name: 'MatchSendOutOrderAllocationList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, AllocateType, dealerSubareaScopeList },
+  components: { STable, VSelect, rangeDate, dealerSubareaScopeList },
   data () {
     return {
       spinning: false,
@@ -126,7 +120,6 @@ export default {
         beginDate: getDate.getThreeMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
         receiverSn: undefined,
@@ -165,11 +158,10 @@ export default {
         { title: '序号', dataIndex: 'no', width: '3.5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调拨单号', scopedSlots: { customRender: 'allocateNo' }, align: 'center', width: '13.5%' },
-        { title: '调往对象', dataIndex: 'targetName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '调往对象', dataIndex: 'targetName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '发货编号', dataIndex: 'sendNo', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '收货客户名称', dataIndex: 'receiverName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收货客户名称', dataIndex: 'receiverName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '总数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调拨类型', dataIndex: 'allocateTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '对单状态', dataIndex: 'checkStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '对单人员', dataIndex: 'checkPersonName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -195,7 +187,6 @@ export default {
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined
       this.queryParam.allocateNo = ''
       this.queryParam.receiverSn = ''
@@ -240,7 +231,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 238
+      this.tableHeight = window.innerHeight - tableSearchH - 195
     }
   },
   watch: {

+ 137 - 82
src/views/allocationManagement/transferOut/basicInfoModal.vue

@@ -4,7 +4,7 @@
     class="allocateBill-basicInfo-modal"
     :footer="null"
     :maskClosable="false"
-    title="新增"
+    :title="isEdit?'编辑':'新增'"
     v-model="isShow"
     @cancel="isShow = false"
     :width="800">
@@ -17,46 +17,64 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
-        <a-form-model-item label="调往对象" prop="targetType">
-          <a-radio-group v-model="form.targetType" @change="targetTypeChange">
-            <a-radio v-for="(item,index) in targetTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
-          </a-radio-group>
-        </a-form-model-item>
-        <a-form-model-item label="调往对象名称" :prop="isDealer ? 'targetSn' : 'targetName'">
-          <a-select
-            v-if="isDealer"
-            show-search
-            id="allocateBill-basicInfo-dealerName"
-            v-model="form.targetSn"
-            placeholder="请选择"
-            :filter-option="false"
-            :not-found-content="fetching ? undefined : null"
-            @search="fetchUser"
-            @change="handleChange"
-          >
-            <a-spin v-if="fetching" slot="notFoundContent" size="small" />
-            <a-select-option v-for="item in dealerData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
-          </a-select>
-          <a-input v-if="!isDealer" v-model.trim="form.targetName" placeholder="请输入调往对象名称(最多30个字符)" allowClear :maxLength="30" />
-        </a-form-model-item>
-        <a-form-model-item label="调拨类型" prop="allocateTypeSn">
-          <a-select id="allocateBill-basicInfo-allocateTypeSn" v-model="form.allocateTypeSn" placeholder="请选择调拨类型" allowClear >
-            <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-          </a-select>
-        </a-form-model-item>
-        <a-form-model-item label="起止时间" prop="time">
-          <a-range-picker
-            style="width:100%"
-            v-model="form.time"
-            show-time
-            :format="dateFormat"
-            @change="dateChange"
-            @calendarChange="dateCalendarChange"
-            :placeholder="['开始时间', '结束时间']" />
-        </a-form-model-item>
-        <a-form-model-item label="备注" prop="remark">
-          <a-textarea id="allocateBill-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
-        </a-form-model-item>
+        <a-row :gutter="15">
+          <a-col :md="12" :sm="24" v-if="!isEdit">
+            <a-form-model-item label="调往对象" prop="targetType">
+              <a-radio-group v-model="form.targetType" @change="targetTypeChange">
+                <a-radio v-for="(item,index) in targetTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24" v-if="!isEdit">
+            <a-form-model-item label="调往对象名称" :prop="isDealer ? 'targetSn' : 'targetName'">
+              <a-select
+                v-if="isDealer"
+                show-search
+                id="allocateBill-basicInfo-dealerName"
+                v-model="form.targetSn"
+                placeholder="请选择经销商"
+                :filter-option="false"
+                :not-found-content="fetching ? undefined : null"
+                @search="fetchUser"
+                @change="handleChange"
+              >
+                <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+                <a-select-option v-for="item in dealerData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+              </a-select>
+              <a-input v-if="!isDealer" v-model.trim="form.targetName" placeholder="请输入调往对象名称(最多30个字符)" allowClear :maxLength="30" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="费用/调拨类型" prop="costTypeSn">
+              <AllocateType id="allocateBill-basicInfo-allocateTypeSn" v-model="allocateTypeVal" placeholder="请选择费用/调拨类型" @change="allocateTypeChange"></AllocateType>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="费用归属品牌">
+              <ProductBrand id="allocateBill-basicInfo-productBrandSn" @change="changeBrand" v-model="form.productBrandSn" placeholder="请选择费用归属品牌(单选)"></ProductBrand>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="费用归属品类">
+              <productTypeAll placeholder="请选择费用归属品类(单选,可选二级或三级)" @change="changeProductType" v-model="productType" id="allocateBill-basicInfo-productType"></productTypeAll>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="起止时间" prop="time">
+              <a-range-picker
+                style="width:100%"
+                v-model="form.time"
+                :format="dateFormat"
+                @change="dateChange"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="24" :sm="24">
+            <a-form-model-item label="备注" prop="remark" :wrapperCol="{ span: 20 }" :labelCol="{ span: 4 }">
+              <a-textarea id="allocateBill-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
       </a-form-model>
       <div class="btn-cont">
         <a-button type="primary" :loading="spinning" id="allocateBill-basicInfo-modal-save" @click="handleSave">保存</a-button>
@@ -68,23 +86,25 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import moment from 'moment'
 import debounce from 'lodash/debounce'
 import { VSelect } from '@/components'
 import { allocateBillSave } from '@/api/allocateBill'
 import { dealerSubareaScopeList } from '@/api/dealer'
 import { getLookUpData } from '@/api/data'
-import { allocateTypeAllList } from '@/api/allocateType'
+import ProductBrand from '@/views/common/productBrand.js'
+import productTypeAll from '@/views/common/productTypeAll.js'
+import AllocateType from '@/views/common/allocateType.js'
 export default {
   name: 'TransferOutBasicInfoModal',
   mixins: [commonMixin],
-  components: { VSelect },
+  components: { VSelect, ProductBrand, productTypeAll, AllocateType },
   props: {
     openModal: {
       //  弹框显示状态
       type: Boolean,
       default: false
-    }
+    },
+    detailData: Object
   },
   data () {
     this.fetchUser = debounce(this.fetchUser, 800)
@@ -92,14 +112,21 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
       formItemLayout: {
-        labelCol: { span: 4 },
-        wrapperCol: { span: 20 }
+        labelCol: { span: 8 },
+        wrapperCol: { span: 16 }
       },
+      productType: [],
       form: {
         targetType: 'DEALER',
         targetSn: undefined,
         targetName: '',
-        allocateTypeSn: undefined,
+        costTypeSn: '',
+        allocateTypeSn: '',
+        allocateSortSn: '',
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
         time: [],
         promoStartDate: '',
         promoEndDate: '',
@@ -108,15 +135,15 @@ export default {
       rules: {
         targetType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
         targetSn: [{ required: true, message: '请选择调往对象名称', trigger: 'change' }],
-        targetName: [{ required: true, message: '请输入调往对象名称', trigger: 'blur' }],
-        allocateTypeSn: [{ required: true, message: '请选择调拨类型', trigger: 'change' }]
+        costTypeSn: [{ required: true, message: '请选择费用/调拨类型', trigger: 'change' }],
+        targetName: [{ required: true, message: '请输入调往对象名称', trigger: 'blur' }]
       },
       fetching: false,
       dealerData: [], //  经销商  下拉数据
       targetTypeList: [], //  调往对象类型
-      allocateTypeList: [], //  调拨类型
-      dateFormat: 'YYYY-MM-DD HH:mm:ss',
-      selectPriceDate: ''
+      allocateTypeVal: [],
+      dateFormat: 'YYYY-MM-DD',
+      isEdit: false
     }
   },
   computed: {
@@ -126,27 +153,40 @@ export default {
     }
   },
   methods: {
-	  // 不可选日期
-	  disabledDate (current) {
-      // 可选今天以后的时间(包含今天),所选时间跨度最多可为一年
-      const minYearVs = moment().subtract(1, 'day') // 今天以后,包含今天
-	    // //  限制最多只能查一年区间的数据
-	    if (this.selectPriceDate) {
-        const maxYearVs = moment(this.selectPriceDate, 'YYYY-MM-DD HH:mm:ss').add(1, 'years') //  当前选中开始日期后推一年
-        return current && current < minYearVs || current && current > maxYearVs
-      } else {
-        return current && current < minYearVs
-	    }
-	  },
     // 日期  change
     dateChange (date, dateStrings) {
-      this.selectPriceDate = ''
+      console.log(date, dateStrings)
       this.form.time = dateStrings
-      this.form.promoStartDate = dateStrings[0] || ''
-      this.form.promoEndDate = dateStrings[1] || ''
+      this.form.promoStartDate = date.length ? dateStrings[0] : ''
+      this.form.promoEndDate = date.length ? dateStrings[1] : ''
     },
-    dateCalendarChange (date, dateStrings) {
-      this.selectPriceDate = date[0]
+    // 调拨类别 change
+    allocateTypeChange (val, opt) {
+      console.log(val, opt, '------------')
+      this.allocateTypeVal = val || ''
+      this.form.costTypeSn = val && val[0] ? val[0] : ''
+      this.form.allocateSortSn = val && val[1] ? val[1] : ''
+      this.form.allocateTypeSn = val && val[2] ? val[2] : ''
+      // 名称
+      this.form.costTypeName = opt && opt[0] ? opt[0].name : ''
+      this.form.allocateSortName = opt && opt[1] ? opt[1].name : ''
+      this.form.allocateTypeName = opt && opt[2] ? opt[2].name : ''
+    },
+    //  产品分类  change
+    changeProductType (val, id, opt) {
+      console.log(val, opt, '------------')
+      this.form.productTypeSn1 = val && val[0] ? val[0] : ''
+      this.form.productTypeSn2 = val && val[1] ? val[1] : ''
+      this.form.productTypeSn3 = val && val[2] ? val[2] : ''
+      // 名称
+      this.form.productTypeName1 = opt && opt[0] ? opt[0].productTypeName : ''
+      this.form.productTypeName2 = opt && opt[1] ? opt[1].productTypeName : ''
+      this.form.productTypeName3 = opt && opt[2] ? opt[2].productTypeName : ''
+    },
+    // 品牌
+    changeBrand (val, id, opt) {
+      console.log(val, opt, '------------')
+      this.form.productBrandName = opt ? opt.brandName : ''
     },
     // 搜索经销商
     fetchUser (value) {
@@ -173,6 +213,9 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
+          if (!form.productBrandName) {
+            form.productBrandSn = ''
+          }
           _this.spinning = true
           allocateBillSave(form).then(res => {
             if (res.status == 200) {
@@ -210,16 +253,6 @@ export default {
           _this.targetTypeList = []
         }
       })
-    },
-    //  调拨类型
-    getAllocateTypeAllList () {
-      allocateTypeAllList().then(res => {
-        if (res.status == 200) {
-          this.allocateTypeList = res.data
-        } else {
-          this.allocateTypeList = []
-        }
-      })
     }
   },
   watch: {
@@ -232,11 +265,19 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
+        this.allocateTypeVal = []
+        this.productType = []
         this.form = {
           targetType: 'DEALER',
           targetSn: undefined,
           targetName: '',
-          allocateTypeSn: undefined,
+          costTypeSn: '',
+          allocateTypeSn: '',
+          allocateSortSn: '',
+          productBrandSn: undefined, //  产品品牌
+          productTypeSn1: '', //  产品一级分类
+          productTypeSn2: '', //  产品二级分类
+          productTypeSn3: '', //  产品三级分类
           time: [],
           promoStartDate: '',
           promoEndDate: '',
@@ -244,7 +285,21 @@ export default {
         }
       } else {
         this.getTargetTypeList()
-        this.getAllocateTypeAllList()
+        // 编辑
+        if (this.detailData) {
+          this.isEdit = true
+          this.form = Object.assign(this.form, this.detailData)
+          this.allocateTypeVal = [this.detailData.costTypeSn, this.detailData.allocateSortSn, this.detailData.allocateTypeSn]
+          if (this.detailData.productTypeSn1) {
+            this.productType = [this.detailData.productTypeSn1, this.detailData.productTypeSn2, this.detailData.productTypeSn3]
+          }
+          if (this.form.promoStartDate && this.form.promoEndDate) {
+            this.form.time = [this.form.promoStartDate, this.form.promoEndDate]
+          }
+          if (!this.form.productBrandSn) {
+            this.form.productBrandSn = undefined
+          }
+        }
       }
     }
   }

+ 36 - 21
src/views/allocationManagement/transferOut/detail.vue

@@ -39,7 +39,7 @@
             v-if="$hasPermissions('B_transferOut_detail_export')"
             id="allocateBillDetail-export-btn"
             :disabled="localDataSource.length==0"
-            @click="handleExcel('ALLOCATE_BILL','调拨明细')">导出Excel</a-button>
+            @click="handlePrint('dbExport')">导出Excel</a-button>
           <a-button
             key="1"
             type="default"
@@ -58,9 +58,28 @@
               <a-descriptions-item label="发货编号">{{ (basicInfoData&&basicInfoData.sendNo) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="收货客户名称">{{ (basicInfoData&&basicInfoData.receiverName) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨单号">{{ (basicInfoData&&basicInfoData.allocateNo) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="调拨类型">{{ (basicInfoData&&basicInfoData.allocateTypeName) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="打印状态">{{ (basicInfoData&&basicInfoData.printStateDictValue) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="费用类型">
+                {{ (basicInfoData&&basicInfoData.costTypeName) || '--' }}
+              </a-descriptions-item>
+              <a-descriptions-item label="调拨类型">
+                <div>
+                  <span v-if="basicInfoData&&basicInfoData.allocateSortName">{{ basicInfoData.allocateSortName || '--' }}</span>
+                  <span v-if="basicInfoData&&basicInfoData.allocateTypeName">/{{ basicInfoData.allocateTypeName || '--' }}</span>
+                </div>
+              </a-descriptions-item>
+              <a-descriptions-item label="费用归属品牌">
+                {{ (basicInfoData&&basicInfoData.productBrandName) || '--' }}
+              </a-descriptions-item>
+              <a-descriptions-item label="费用归属品类">
+                <div>
+                  <span v-if="basicInfoData&&basicInfoData.productTypeName1">{{ basicInfoData.productTypeName1 || '--' }}</span>
+                  <span v-else>--</span>
+                  <span v-if="basicInfoData&&basicInfoData.productTypeName2">/{{ basicInfoData.productTypeName2 || '--' }}</span>
+                  <span v-if="basicInfoData&&basicInfoData.productTypeName3">/{{ basicInfoData.productTypeName3 || '--' }}</span>
+                </div>
+              </a-descriptions-item>
               <a-descriptions-item label="起止时间">
                 <span v-if="basicInfoData&&(basicInfoData.promoStartDate || basicInfoData.promoEndDate)">{{ (basicInfoData&&basicInfoData.promoStartDate) || '--' }} ~ {{ (basicInfoData&&basicInfoData.promoEndDate) || '--' }}</span>
                 <span v-else>--</span>
@@ -97,7 +116,7 @@
       :openModal="openModal"
       :itemData="basicInfoData"
       :nowType="nowType"
-      @export="exportFl"
+      @export="exportOk"
       @ok="handleOk"
       @close="openModal=false" />
   </div>
@@ -154,14 +173,10 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '27%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '成本价', dataIndex: 'cost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出数量', dataIndex: 'qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-        // { title: '成本小计(¥)', dataIndex: 'totalCost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '售价小计(¥)', dataIndex: 'totalPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '调出数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
         arr.splice(5, 0, { title: '成本价', dataIndex: 'cost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
@@ -172,6 +187,7 @@ export default {
         arr.splice(ind, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.splice(ind + 3, 0, { title: '售价小计(¥)', dataIndex: 'totalPrice', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
+      arr.push({ title: '费用归属部门', dataIndex: 'departmentName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
       return arr
     }
   },
@@ -204,25 +220,24 @@ export default {
     handleEdit () {
       this.$router.push({ path: `/allocationManagement/transferOut/edit/${this.basicInfoData.allocateSn}/${this.basicInfoData.dealerLevel}` })
     },
-    // 导出
-    handleExcel (printType, filename, data) {
+    // 打印/导出
+    handlePrint (type) {
+      this.nowType = type
+      this.openModal = true
+    },
+    // 导出成功
+    exportOk (data) {
       const _this = this
+      const filename = this.nowType == 'dbflExport' ? '调拨分类' : '调拨'
       this.spinning = true
-      const params = { allocateSn: this.outBizSn || this.$route.params.sn, printType: printType, ...data }
+      const params = { allocateSn: this.outBizSn || this.$route.params.sn, ...data }
       params.showCostFlag = this.$hasPermissions('B_isShowCost')
       params.showAmountFlag = this.$hasPermissions('B_isShowPrice')
       exportExcel(allocateBillDetailExcel, params, filename, function () {
         _this.spinning = false
       })
     },
-    exportFl (data) {
-      this.handleExcel(data.printType, '调拨分类', data)
-    },
-    // 打印预览/快捷打印
-    handlePrint (type) {
-      this.nowType = type
-      this.openModal = true
-    },
+    // 打印成功
     handleOk (objs) {
       const _this = this
       const params = JSON.parse(JSON.stringify(objs))

+ 190 - 90
src/views/allocationManagement/transferOut/edit.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="allocateBillEdit-wrap">
-    <!-- <a-spin :spinning="spinning" tip="Loading..."> -->
     <div class="ant-spin-nested-loading">
       <a-page-header :ghost="false" :backIcon="false" class="allocateBillEdit-back" >
         <!-- 自定义的二级文字标题 -->
@@ -52,18 +51,37 @@
               <a-descriptions-item label="发货编号">{{ (basicInfoData&&basicInfoData.sendNo) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="收货客户名称">{{ (basicInfoData&&basicInfoData.receiverName) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨单号">{{ (basicInfoData&&basicInfoData.allocateNo) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="调拨类型">
-                <AllocateType id="allocateEdit-allocateTypeSn" style="width: 200px;" @change="changeAllocateType" v-model="basicInfoData.allocateTypeSn"></AllocateType>
-              </a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="打印状态">{{ (basicInfoData&&basicInfoData.printStateDictValue) || '--' }}</a-descriptions-item>
+            </a-descriptions>
+            <a-divider>以下信息可修改,请点击<span style="color: dodgerblue;font-size: 14px;cursor: pointer;" @click="editRemark = true" ><a-icon type="form" title="编辑基础信息" />编辑</span></a-divider>
+            <a-descriptions :column="3">
+              <a-descriptions-item label="费用类型">
+                {{ (basicInfoData&&basicInfoData.costTypeName) || '--' }}
+              </a-descriptions-item>
+              <a-descriptions-item label="调拨类型">
+                <div>
+                  <span v-if="basicInfoData.allocateSortName">{{ basicInfoData.allocateSortName || '--' }}</span>
+                  <span v-if="basicInfoData.allocateTypeName">/{{ basicInfoData.allocateTypeName || '--' }}</span>
+                </div>
+              </a-descriptions-item>
+              <a-descriptions-item label="费用归属品牌">
+                {{ (basicInfoData&&basicInfoData.productBrandName) || '--' }}
+              </a-descriptions-item>
+              <a-descriptions-item label="费用归属品类">
+                <div>
+                  <span v-if="basicInfoData.productTypeName1">{{ basicInfoData.productTypeName1 || '--' }}</span>
+                  <span v-else>--</span>
+                  <span v-if="basicInfoData.productTypeName2">/{{ basicInfoData.productTypeName2 || '--' }}</span>
+                  <span v-if="basicInfoData.productTypeName3">/{{ basicInfoData.productTypeName3 || '--' }}</span>
+                </div>
+              </a-descriptions-item>
               <a-descriptions-item label="起止时间">
                 <span v-if="basicInfoData&&(basicInfoData.promoStartDate || basicInfoData.promoEndDate)">{{ (basicInfoData&&basicInfoData.promoStartDate) || '--' }} ~ {{ (basicInfoData&&basicInfoData.promoEndDate) || '--' }}</span>
                 <span v-else>--</span>
               </a-descriptions-item>
               <a-descriptions-item label="备注">
-                {{ (basicInfoData&&basicInfoData.remark) }}
-                <a-icon type="form" title="编辑备注" @click="editRemark = true" style="color: dodgerblue;font-size: 14px;" />
+                {{ (basicInfoData&&basicInfoData.remark||'--') }}
               </a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
@@ -111,11 +129,16 @@
               :customRow="handleClickRow"
               :data="loadData"
               :scroll="{ y: 300 }"
-              :defaultLoadData="false"
               bordered>
               <!-- 操作 -->
               <template slot="action1" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-primary" @click="handleAdd(record)" id="allocateBillEdit-add-btn">添加</a-button>
+                <a-button
+                  size="small"
+                  type="link"
+                  class="button-primary"
+                  :loading="spinning"
+                  @click="handleAdd(record, false, 'noRefresh')"
+                >添加</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
@@ -135,7 +158,7 @@
             </a-alert>
             <!-- 筛选条件 -->
             <a-row :gutter="15">
-              <a-col :span="17">
+              <a-col :span="16">
                 <div class="table-page-search-wrapper">
                   <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
                     <a-row :gutter="15">
@@ -157,7 +180,13 @@
                   </a-form>
                 </div>
               </a-col>
-              <a-col :span="7" style="text-align: right;">
+              <a-col :span="8" style="text-align: right;">
+                <span v-if="selNums">已选{{ selNums }}项</span>
+                <a-button
+                  style="margin:0 15px;"
+                  size="small"
+                  id="salesEdit-plDel-btn"
+                  @click="openPlSet">批量设置费用归属</a-button>
                 <a-button size="small" id="allocateBillEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
                 <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
               </a-col>
@@ -170,10 +199,11 @@
               index="1"
               tableId="table2"
               :rowKey="(record) => record.id"
+              :row-selection="{ columnWidth: 40 }"
+              @rowSelection="rowSelectionFun"
               :columns="chooseColumns"
               :data="chooseLoadData"
               :scroll="{ y: 300 }"
-              :defaultLoadData="false"
               bordered>
               <!-- 售价 -->
               <template slot="price" slot-scope="text, record, index">
@@ -209,15 +239,35 @@
                   @blur="e => qtyBlur(e.target.value, record)"
                   style="width: 100%;" />
               </template>
+              <!-- 费用归属部门 -->
+              <template slot="department" slot-scope="text, record">
+                <a-select
+                  style="width:100%"
+                  placeholder="请选择部门"
+                  size="small"
+                  allowClear
+                  v-model="record.departmentSn"
+                  :showSearch="true"
+                  @change="e => handleChange(e, record)"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in departmentList" :key="item.departmentSn" :value="item.departmentSn">{{ item.name }}</a-select-option>
+                </a-select>
+              </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="allocateBillEdit-del-btn">删除</a-button>
+                <a-button
+                  size="small"
+                  type="link"
+                  class="button-error"
+                  :loading="spinning"
+                  @click="handleDel(record)"
+                  id="allocateBillEdit-del-btn">删除</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
         </a-collapse>
       </a-card>
-    <!-- </a-spin> -->
     </div>
     <div class="affix-cont" v-if="basicInfoData">
       <a-button
@@ -229,6 +279,7 @@
         @click="handleOpen"
         style="padding: 0 60px;">提交</a-button>
     </div>
+
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
     <!-- 打印导出 -->
@@ -241,28 +292,27 @@
       @close="openModal=false" />
     <!-- 提交调拨单 -->
     <dsModal ref="dsModal" :dealerLevel="$route.params.dealerLevel" :openModal="showDsModal" @close="showDsModal=false" @ok="handleSubmit" />
-    <!-- 修改基础信息 -->
-    <a-modal
-      centered
-      wrapClassName="allocateBill-editRemark-modal"
-      v-if="basicInfoData"
-      :footer="null"
-      :maskClosable="false"
-      title="修改备注"
-      v-model="editRemark"
-      @cancel="editRemark = false"
-      :width="600">
-      <a-textarea
-        v-model="basicInfoData.remark"
-        placeholder="请输入备注(最多120个字符)"
-        :maxLength="120"
-        :auto-size="{ minRows: 3, maxRows: 5 }"
-      />
-      <div class="btn-cont">
-        <a-button type="primary" id="allocateBill-basicInfo-modal-save" @click="handleEditRemark">保存</a-button>
-        <a-button id="allocateBill-basicInfo-modal-back" @click="editRemark = false" style="margin-left: 15px;">取消</a-button>
+    <!-- 编辑基础信息 -->
+    <basic-info-modal :openModal="editRemark" :detailData="basicInfoData" @ok="getDetail" @close="editRemark=false" />
+    <!-- 批量设置部门 -->
+    <commonModal modalTit="批量设置费用归属部门" :openModal="showPlModal" @cancel="closePlSet" @ok="setPlSetOk">
+      <div style="text-align: center;">
+        <div style="margin-bottom: 15px;font-size: 14px;"><strong>请选择费用归属部门</strong></div>
+        <div style="line-height: 24px;">
+          <div>
+            <a-select
+              style="width:100%"
+              placeholder="请选择部门"
+              allowClear
+              v-model="plSetVal"
+              :showSearch="true"
+              option-filter-prop="children"
+              :filter-option="filterOption">
+              <a-select-option v-for="item in departmentList" :key="item.departmentSn" :value="item.departmentSn">{{ item.name }}</a-select-option>
+            </a-select></div>
+        </div>
       </div>
-    </a-modal>
+    </commonModal>
   </div>
 </template>
 
@@ -270,23 +320,26 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import ImportGuideModal from './importGuideModal.vue'
+import basicInfoModal from './basicInfoModal.vue'
 import printModal from './printModal.vue'
 import dsModal from './dsModal.vue'
+import commonModal from '@/views/common/commonModal.vue'
 import { printFun, exportExcel } from '@/libs/JGPrint.js'
 import { queryStockProductPage } from '@/api/stock'
 import { productPriceInfo } from '@/api/product'
-import AllocateType from '@/views/common/allocateType.js'
-import { allocateBillSave, allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert, allocateBillDetailExcel } from '@/api/allocateBill'
+import { departmentQueryList } from '@/api/expenseManagement'
+import { allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert, allocateBillDetailExcel, updateBatchDepartment } from '@/api/allocateBill'
 
 export default {
   name: 'TransferOutEdit',
   mixins: [commonMixin],
-  components: { STable, VSelect, ImportGuideModal, AllocateType, printModal, dsModal },
+  components: { STable, VSelect, ImportGuideModal, printModal, dsModal, basicInfoModal, commonModal },
   data () {
     return {
       spinning: false,
       showDsModal: false,
       editRemark: false,
+      showPlModal: false,
       queryParam: {
         productCode: '',
         productName: '',
@@ -304,6 +357,7 @@ export default {
       productTypeList: [], //  产品分类  下拉数据
       productType: [],
       warehouseList: [], //  仓库  下拉数据
+      departmentList: [], // 部门列表
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -326,16 +380,17 @@ export default {
         this.chooseDisabled = true
         const params = Object.assign(parameter, this.chooseQueryParam, { allocateSn: this.$route.params.sn })
         return allocateBillDetailList(params).then(res => {
-          this.getDetailCount()
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
             data.list[i].qtyBackups = data.list[i].qty
             data.list[i].priceBackups = data.list[i].price
+            data.list[i].departmentSn = data.list[i].departmentSn || undefined
           }
           this.localDataSource = data.list || []
           this.chooseDisabled = false
+          this.getDetailCount(params)
           return data
         })
       },
@@ -343,10 +398,15 @@ export default {
       basicInfoData: null, // 基本信息
       openGuideModal: false, //  导入产品引导
       openModal: false,
-      nowType: null
+      nowType: null,
+      rowSelectionInfo: null,
+      plSetVal: undefined
     }
   },
   computed: {
+    selNums () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
+    },
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -378,6 +438,7 @@ export default {
         // { title: '售价', scopedSlots: { customRender: 'price' }, width: '10%', align: 'center' },
         { title: '库存数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
+        { title: '费用归属部门', scopedSlots: { customRender: 'department' }, width: '10%', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
       ]
@@ -392,55 +453,77 @@ export default {
     }
   },
   methods: {
-    // 修改备注
-    handleEditRemark () {
-      const _this = this
-      const params = _this.basicInfoData
-      allocateBillSave({
-        allocateSn: params.allocateSn,
-        targetType: params.targetType,
-        targetSn: params.targetSn,
-        targetName: params.targetName,
-        allocateTypeSn: params.allocateTypeSn,
-        remark: params.remark
-      }).then(res => {
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 获取部门数据
+    getDepartmentList () {
+      departmentQueryList({}).then(res => {
         if (res.status == 200) {
-          _this.$message.success(res.message)
-          _this.getDetail()
+          this.departmentList = res.data
         } else {
-          _this.spinning = false
+          this.departmentList = []
         }
       })
-      _this.editRemark = false
     },
-    // 修改调拨类型
-    changeAllocateType (val) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定要更改调拨类型吗?',
-        centered: true,
-        onOk () {
-          _this.handleEditRemark()
-        },
-        onCancel () {
-          _this.getDetail()
-        }
-      })
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 批量设置退货原因
+    openPlSet () {
+      if (this.selNums) {
+        this.showPlModal = true
+      } else {
+        this.$message.warning('请先选择产品!')
+      }
+    },
+    closePlSet () {
+      this.showPlModal = false
+      this.plSetVal = undefined
+    },
+    setPlSetOk () {
+      if (!this.plSetVal) {
+        this.$message.warning('请选择费用归属部门!')
+      } else {
+        const snList = []
+        const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+        const department = this.departmentList.find(item => item.departmentSn == this.plSetVal)
+        arr.map(item => {
+          snList.push({
+            'allocateDetailSn': item.allocateDetailSn,
+            'departmentSn': this.plSetVal,
+            'departmentName': department ? department.name : ''
+          })
+        })
+        this.showPlModal = false
+        this.$message.loading('正在设置...', 0)
+        updateBatchDepartment(snList).then(res => {
+          if (res.status == 200) {
+            this.closePlSet()
+            this.refashPage()
+          }
+          this.$message.destroy()
+        })
+      }
     },
     //  重置
-    resetSearchForm () {
+    resetSearchForm (flag) {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
       this.queryParam.productOrigCode = ''
-      this.$refs.table.refresh(true)
+      if (!flag) {
+        this.$refs.table.refresh(true)
+      }
     },
     // 双击快速添加
     handleClickRow (record) {
       return {
         on: {
           dblclick: (event) => {
-            this.handleAdd(record)
+            this.handleAdd(record, false, 'noRefresh')
           }
         }
       }
@@ -454,10 +537,12 @@ export default {
       })
     },
     // 已选产品  重置
-    chooseResetSearchForm () {
+    chooseResetSearchForm (flag) {
       this.chooseQueryParam.productCode = ''
       this.chooseQueryParam.productName = ''
-      this.$refs.chooseTable.refresh(true)
+      if (!flag) {
+        this.$refs.chooseTable.refresh(true)
+      }
     },
     //  添加/编辑
     handleAdd (row, isEdit, isRefresh) {
@@ -467,7 +552,9 @@ export default {
         cost: isEdit ? row.cost : row.lastStockCost,
         price: isEdit ? row.price : row.productPrice,
         qty: isEdit ? row.qty : 1, //  添加时调出数量默认为1
-        productSn: row.productSn
+        productSn: row.productSn,
+        departmentSn: row.departmentSn,
+        departmentName: row.departmentName
       }
       if (isEdit) { // 编辑
         // 清空数量时,值应保持未清空前的值,因数量不可为空
@@ -488,6 +575,7 @@ export default {
             this.$refs.table.refresh()
           }
           this.$refs.chooseTable.refresh()
+          this.$refs.chooseTable.clearSelected()
           this.spinning = false
         } else {
           this.spinning = false
@@ -504,18 +592,22 @@ export default {
         centered: true,
         onOk () {
           if (isAll) { //  整单删除
+            _this.spinning = true
             allocateBillDetailDelAll({ sn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.refashPage()
               }
+              _this.spinning = false
             })
           } else { //  单个删除
+            _this.spinning = true
             allocateBillDetailDel({ id: row.id }).then(res => {
               if (res.status == 200) {
                 _this.$message.success(res.message)
                 _this.refashPage()
               }
+              _this.spinning = false
             })
           }
         }
@@ -563,8 +655,8 @@ export default {
       })
     },
     // 合计
-    getDetailCount () {
-      allocateBillDetailCount({ allocateSn: this.$route.params.sn }).then(res => {
+    getDetailCount (params) {
+      allocateBillDetailCount({ allocateSn: this.$route.params.sn, ...params }).then(res => {
         if (res.status == 200) {
           this.productTotal = res.data
         } else {
@@ -583,6 +675,17 @@ export default {
         this.handleAdd(record, 'edit', 'noRefresh')
       }
     },
+    // 已选产品 修改部门
+    handleChange (value, record) {
+      if (value) {
+        const department = this.departmentList.find(item => item.departmentSn == record.departmentSn)
+        record.departmentName = department ? department.name : ''
+      } else {
+        record.departmentSn = ''
+        record.departmentName = ''
+      }
+      this.handleAdd(record, 'edit', 'noRefresh')
+    },
     // 已选产品 售价  change
     priceChange (val, record) {
       //  光标移出,值发生改变再调用编辑接口
@@ -645,13 +748,15 @@ export default {
     },
     // 刷新当前页面
     refashPage () {
-      this.$refs.table.refresh()
+      // this.$refs.table.refresh()
+      this.$refs.chooseTable.clearSelected()
       this.$refs.chooseTable.refresh()
     },
     pageInit () {
+      this.getDepartmentList()
       this.getDetail()
-      this.resetSearchForm()
-      this.chooseResetSearchForm()
+      // this.resetSearchForm(1)
+      // this.chooseResetSearchForm(1)
     }
   },
   mounted () {
@@ -676,10 +781,11 @@ export default {
     position: relative;
     height: 100%;
     box-sizing: border-box;
-    >.ant-spin-nested-loading{
-      overflow-y: scroll;
-      height: 100%;
-      padding-bottom: 51px;
+    > .ant-spin-nested-loading {
+        position: relative;
+        height: 100%;
+        overflow: auto;
+        padding-bottom: 50px;
     }
     .allocateBillEdit-back{
       margin-bottom: 10px;
@@ -706,10 +812,4 @@ export default {
       }
     }
   }
-  .allocateBill-editRemark-modal{
-    .btn-cont{
-      text-align: center;
-      padding-top: 20px;
-    }
-  }
 </style>

+ 29 - 8
src/views/allocationManagement/transferOut/list.vue

@@ -16,8 +16,8 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨类型">
-                <AllocateType id="allocateBillList-allocateTypeSn" v-model="queryParam.allocateTypeSn"></AllocateType>
+              <a-form-item label="费用/调拨类型">
+                <AllocateType id="allocateBillList-costTypeName" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -114,6 +114,14 @@
           <span v-if="record.promoStartDate || record.promoEndDate">{{ record.promoStartDate }} ~ {{ record.promoEndDate }}</span>
           <span v-else>--</span>
         </template>
+        <!-- 调拨类型 -->
+        <template slot="allocateType" slot-scope="text, record">
+          <div>
+            <span v-if="record.allocateSortName">{{ record.allocateSortName }}</span>
+            <span v-if="record.allocateSortName&&record.allocateTypeName">/</span>
+            <span v-if="record.allocateTypeName">{{ record.allocateTypeName }}</span>
+          </div>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -180,11 +188,14 @@ export default {
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
+      allocateTypeVal: [],
       queryParam: { //  查询条件
         beginDate: getDate.getThreeMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
+        costTypeSn: undefined, // 费用类型
+        allocateSortSn: undefined, //  调拨类型1
+        allocateTypeSn: undefined, //  调拨类型2
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
         receiverSn: undefined,
@@ -221,22 +232,23 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '3.5%', align: 'center' },
-        { title: '创建时间', dataIndex: 'createDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调拨单号', scopedSlots: { customRender: 'allocateNo' }, align: 'center', width: '13.5%' },
-        { title: '起止时间', scopedSlots: { customRender: 'promoDate' }, align: 'center', width: '8%' },
+        { title: '起止时间', scopedSlots: { customRender: 'promoDate' }, align: 'center', width: '6%' },
         { title: '调往对象', dataIndex: 'targetName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户类型', dataIndex: 'dealerLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '发货编号', dataIndex: 'sendNo', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '收货客户名称', dataIndex: 'receiverName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '总数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '总售价', dataIndex: 'totalPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '审核时间', dataIndex: 'auditTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨类型', dataIndex: 'allocateTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditTime', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用类型', dataIndex: 'costTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类型', scopedSlots: { customRender: 'allocateType' }, width: '6%', align: 'center' },
         { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印状态', dataIndex: 'printStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印次数', dataIndex: 'printCount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '对单状态', dataIndex: 'checkStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
         arr.splice(8, 0, { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
@@ -258,18 +270,27 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    changeAllocatype (val, opts) {
+      this.allocateTypeVal = val || []
+      this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
+      this.queryParam.allocateSortSn = val && val[1] ? val[1] : ''
+      this.queryParam.allocateTypeSn = val && val[2] ? val[2] : ''
+    },
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.targetName = ''
+      this.queryParam.costTypeSn = undefined
+      this.queryParam.allocateSortSn = undefined
       this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined
       this.queryParam.checkStatus = undefined
       this.queryParam.printState = undefined
       this.queryParam.allocateNo = ''
       this.queryParam.receiverSn = undefined
+      this.allocateTypeVal = []
       this.$refs.receiverSn.resetForm()
       this.$refs.table.refresh(true)
     },

+ 39 - 33
src/views/allocationManagement/transferOut/printModal.vue

@@ -29,7 +29,14 @@
             </a-select-option>
           </a-select>
         </a-form-model-item>
-        <a-form-model-item label="产品价格" prop="priceType" v-if="nowType=='dbPrint'">
+        <a-form-model-item label="货位编号" prop="orderBy" v-if="nowType=='dbflPrint'">
+          <a-radio-group v-model="form.orderBy">
+            <a-radio value="ASC">打印(↑升序)</a-radio>
+            <a-radio value="DESC">打印(↓降序)</a-radio>
+            <a-radio value="-1">不打印</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+        <a-form-model-item label="产品价格" prop="priceType" v-if="nowType=='dbPrint'||nowType=='dbExport'">
           <a-radio-group v-model="form.priceType">
             <a-radio value="ALLOCATE_BILL_PRICE">销售价</a-radio>
             <a-radio value="ALLOCATE_BILL_COST">成本价</a-radio>
@@ -40,20 +47,20 @@
       <div class="btn-cont">
         <a-button id="allocateBill-print-close" @click="handleClose('preview')">取消</a-button>
         <a-button
-          v-if="nowType!='dbflExport'"
+          v-if="nowType=='dbflPrint'||nowType=='dbPrint'"
           id="allocateBill-print-save"
           type="primary"
           class="button-info"
           @click="handleSave('preview')"
           style="margin-left: 15px;">打印预览</a-button>
         <a-button
-          v-if="hidePrint&&nowType!='dbflExport'"
+          v-if="hidePrint&&(nowType=='dbflPrint'||nowType=='dbPrint')"
           type="primary"
           id="allocateBill-print-back"
           @click="handleSave('print')"
           style="margin-left: 15px;">确定打印</a-button>
         <a-button
-          v-if="nowType=='dbflExport'"
+          v-if="nowType=='dbflExport'||nowType=='dbExport'"
           type="primary"
           id="allocateBill-print-back"
           @click="handleSave('export')"
@@ -87,11 +94,13 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       form: {
         id: 'all',
-        priceType: undefined
+        priceType: undefined,
+        orderBy: undefined
       },
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
-        priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }]
+        priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }],
+        orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }]
       },
       formItemLayout: {
         labelCol: { span: 6 },
@@ -110,6 +119,8 @@ export default {
         title = '调拨分类打印'
       } else if (this.nowType == 'dbflExport') {
         title = '调拨分类导出'
+      } else if (this.nowType == 'dbExport') {
+        title = '导出Excel'
       }
       return title
     },
@@ -123,39 +134,34 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          if (_this.nowType == 'dbflPrint') {
+          // 普通打印/导出
+          const obj = {
+            allocateSn: _this.itemData.allocateSn,
+            allocateNo: _this.itemData.allocateNo,
+            printType: _this.form.priceType,
+            isPreview: type == 'preview' ? 1 : 0
+          }
+          // 分类打印/导出
+          if (_this.nowType == 'dbflPrint' || _this.nowType == 'dbflExport') {
             const item = _this.typeList.find(item => item.id == _this.form.id)
             if (item) {
-              const obj = {
-                allocateSn: _this.itemData.allocateSn,
-                allocateNo: _this.itemData.allocateNo,
-                productBrandSn: item.productBrandSn,
-                productTypeSn3: item.productTypeSn3,
-                printType: 'ALLOCATE_BILL_TYPE',
-                isPreview: type == 'preview' ? 1 : 0
-              }
-              _this.$emit('ok', obj)
+              obj.productBrandSn = item.productBrandSn
+              obj.productTypeSn3 = item.productTypeSn3
+              obj.printType = 'ALLOCATE_BILL_TYPE'
             }
-          } else if (_this.nowType == 'dbPrint') {
-            const obj = {
-              allocateSn: _this.itemData.allocateSn,
-              allocateNo: _this.itemData.allocateNo,
-              printType: _this.form.priceType,
-              isPreview: type == 'preview' ? 1 : 0
+            // 打印货位编号
+            if (_this.nowType == 'dbflPrint') {
+              if (_this.form.orderBy != '-1') {
+                obj.orderBy = _this.form.orderBy
+              }
             }
+          }
+          // 打印
+          if (_this.nowType == 'dbPrint' || _this.nowType == 'dbflPrint') {
             _this.$emit('ok', obj)
           } else {
-            const item = _this.typeList.find(item => item.id == _this.form.id)
-            if (item) {
-              const obj = {
-                allocateSn: _this.itemData.allocateSn,
-                allocateNo: _this.itemData.allocateNo,
-                productBrandSn: item.productBrandSn,
-                productTypeSn3: item.productTypeSn3,
-                printType: 'ALLOCATE_BILL_TYPE'
-              }
-              _this.$emit('export', obj)
-            }
+            // 导出
+            _this.$emit('export', obj)
           }
           _this.isShow = false
         } else {

+ 24 - 21
src/views/allocationManagement/transferReturn/basicInfoModal.vue

@@ -44,10 +44,8 @@
           </a-select>
           <a-input v-if="!isDealer" v-model.trim="form.targetName" placeholder="请输入调拨退货对象名称(最多30个字符)" allowClear :maxLength="30" />
         </a-form-model-item>
-        <a-form-model-item label="调拨退货类型" prop="allocateReturnTypeSn">
-          <a-select id="allocateBill-basicInfo-allocateReturnTypeSn" v-model="form.allocateReturnTypeSn" placeholder="请选择调拨退货类型" allowClear >
-            <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-          </a-select>
+        <a-form-model-item label="费用/调拨退货类型" prop="costTypeSn">
+          <AllocateType id="allocateBill-basicInfo-allocateTypeSn" v-model="allocateTypeVal" placeholder="请选择费用/调拨退货类型" @change="allocateTypeChange"></AllocateType>
         </a-form-model-item>
         <a-form-model-item label="是否抓单" prop="grabFlag">
           <v-select
@@ -77,10 +75,10 @@ import debounce from 'lodash/debounce'
 import { VSelect } from '@/components'
 import { allocateReturnSave, allocateReturnQueryBySn } from '@/api/allocateReturn'
 import { dealerSubareaScopeList } from '@/api/dealer'
-import { allocateTypeAllList } from '@/api/allocateType'
+import AllocateType from '@/views/common/allocateType.js'
 export default {
   name: 'TransferOutBasicInfoModal',
-  components: { VSelect },
+  components: { VSelect, AllocateType },
   mixins: [commonMixin],
   props: {
     openModal: {
@@ -98,10 +96,13 @@ export default {
         labelCol: { span: 4 },
         wrapperCol: { span: 20 }
       },
+      allocateTypeVal: [],
       form: {
         targetType: 'DEALER',
         targetSn: undefined,
         targetName: '',
+        costTypeSn: undefined,
+        allocateSortSn: undefined,
         allocateReturnTypeSn: undefined,
         grabFlag: '1',
         remarks: ''
@@ -110,12 +111,11 @@ export default {
         targetType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
         targetSn: [{ required: true, message: '请选择调往对象名称', trigger: 'change' }],
         targetName: [{ required: true, message: '请输入调往对象名称', trigger: 'blur' }],
-        allocateReturnTypeSn: [{ required: true, message: '请选择调拨类型', trigger: 'change' }],
+        costTypeSn: [{ required: true, message: '请选择费用/调拨退货类型', trigger: 'change' }],
         grabFlag: [{ required: true, message: '请选择是否抓单', trigger: 'change' }]
       },
       fetching: false,
-      dealerData: [], //  经销商  下拉数据
-      allocateTypeList: [] //  调拨类型
+      dealerData: [] //  经销商  下拉数据
     }
   },
   computed: {
@@ -144,6 +144,18 @@ export default {
       const ind = this.dealerData.findIndex(item => item.dealerSn == value)
       this.form.targetName = this.dealerData[ind].dealerName
     },
+    // 调拨类别 change
+    allocateTypeChange (val, opt) {
+      console.log(val, opt, '------------')
+      this.allocateTypeVal = val
+      this.form.costTypeSn = val[0] ? val[0] : ''
+      this.form.allocateSortSn = val[1] ? val[1] : ''
+      this.form.allocateReturnTypeSn = val[2] ? val[2] : ''
+      // 名称
+      this.form.costTypeName = opt[0] ? opt[0].name : ''
+      this.form.allocateSortName = opt[1] ? opt[1].name : ''
+      this.form.allocateReturnTypeName = opt[2] ? opt[2].name : ''
+    },
     // 基本信息
     getDetail (data, flag) {
       const _this = this
@@ -190,26 +202,19 @@ export default {
         this.form.grabFlag = '0'
       }
     },
-    //  调拨类型
-    getAllocateTypeAllList () {
-      allocateTypeAllList().then(res => {
-        if (res.status == 200) {
-          this.allocateTypeList = res.data
-        } else {
-          this.allocateTypeList = []
-        }
-      })
-    },
     resetForm () {
       this.$refs.ruleForm.resetFields()
       this.form = {
         targetType: 'DEALER',
         targetSn: undefined,
         targetName: '',
+        costTypeSn: undefined,
+        allocateTypeSn: undefined,
         allocateReturnTypeSn: undefined,
         grabFlag: '1',
         remarks: ''
       }
+      this.allocateTypeVal = []
     }
   },
   watch: {
@@ -222,8 +227,6 @@ export default {
       if (!newValue) {
         this.resetForm()
         this.$emit('close')
-      } else {
-        this.getAllocateTypeAllList()
       }
     }
   }

+ 9 - 1
src/views/allocationManagement/transferReturn/detail.vue

@@ -25,7 +25,15 @@
               <a-descriptions-item label="调拨退货单号">{{ (basicInfoData&&basicInfoData.allocateReturnNo) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetTypeDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="调拨退货类型">{{ (basicInfoData&&basicInfoData.allocateReturnTypeName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="费用类型">
+                {{ (basicInfoData&&basicInfoData.costTypeName) || '--' }}
+              </a-descriptions-item>
+              <a-descriptions-item label="调拨退货类型">
+                <div>
+                  <span v-if="basicInfoData&&basicInfoData.allocateSortName">{{ basicInfoData.allocateSortName || '--' }}</span>
+                  <span v-if="basicInfoData&&basicInfoData.allocateReturnTypeName">/{{ basicInfoData.allocateReturnTypeName || '--' }}</span>
+                </div>
+              </a-descriptions-item>
               <a-descriptions-item label="是否抓单">{{ basicInfoData&&basicInfoData.grabFlagDictValue || '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>

+ 22 - 6
src/views/allocationManagement/transferReturn/edit.vue

@@ -19,8 +19,13 @@
               <a-descriptions-item label="调拨退货单号">{{ (basicInfoData&&basicInfoData.allocateReturnNo) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetTypeDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="调拨退货类型">
-                <AllocateType id="allocateEdit-allocateReturnTypeSn" style="width: 200px;" @change="changeAllocateType" v-model="basicInfoData.allocateReturnTypeSn"></AllocateType>
+              <a-descriptions-item label="费用/调拨退货类型">
+                <AllocateType
+                  id="allocateEdit-allocateReturnTypeSn"
+                  style="width: 220px;"
+                  v-model="allocateTypeVal"
+                  placeholder="请选择费用/调拨退货类型"
+                  @change="changeAllocateType"></AllocateType>
               </a-descriptions-item>
               <a-descriptions-item label="是否抓单">{{ (basicInfoData&&basicInfoData.grabFlagDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
@@ -332,7 +337,8 @@ export default {
       basicInfoData: null, // 基本信息
       openGuideModal: false, //  导入产品引导
       openModal: false,
-      nowType: null
+      nowType: null,
+      allocateTypeVal: []
     }
   },
   methods: {
@@ -351,8 +357,18 @@ export default {
       _this.editRemark = false
     },
     // 修改调拨类型
-    changeAllocateType (val) {
+    changeAllocateType (val, opt) {
+      console.log(val, opt, '------------')
       const _this = this
+      this.allocateTypeVal = val
+      this.basicInfoData.costTypeSn = val[0] ? val[0] : ''
+      this.basicInfoData.allocateSortSn = val[1] ? val[1] : ''
+      this.basicInfoData.allocateReturnTypeSn = val[2] ? val[2] : ''
+      // 名称
+      this.basicInfoData.costTypeName = opt[0] ? opt[0].name : ''
+      this.basicInfoData.allocateSortName = opt[1] ? opt[1].name : ''
+      this.basicInfoData.allocateReturnTypeName = opt[2] ? opt[2].name : ''
+
       this.$confirm({
         title: '提示',
         content: '确定要更改调拨退货类型吗?',
@@ -492,8 +508,8 @@ export default {
       allocateReturnQueryBySn({ allocateReturnSn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
-          if (!flag) {
-            this.resetSearchForm()
+          if (this.basicInfoData.costTypeSn) {
+            this.allocateTypeVal = [this.basicInfoData.costTypeSn, this.basicInfoData.allocateSortSn, this.basicInfoData.allocateReturnTypeSn]
           }
         } else {
           this.basicInfoData = null

+ 22 - 4
src/views/allocationManagement/transferReturn/editGrp.vue

@@ -19,8 +19,13 @@
               <a-descriptions-item label="调拨退货单号">{{ (basicInfoData&&basicInfoData.allocateReturnNo) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetTypeDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="调拨退货类型">
-                <AllocateType id="allocateEdit-allocateReturnTypeSn" style="width: 200px;" @change="changeAllocateType" v-model="basicInfoData.allocateReturnTypeSn"></AllocateType>
+              <a-descriptions-item label="费用/调拨退货类型">
+                <AllocateType
+                  id="allocateEdit-allocateReturnTypeSn"
+                  style="width: 220px;"
+                  v-model="allocateTypeVal"
+                  placeholder="请选择费用/调拨退货类型"
+                  @change="changeAllocateType"></AllocateType>
               </a-descriptions-item>
               <a-descriptions-item label="是否抓单">{{ (basicInfoData&&basicInfoData.grabFlagDictValue) || '--' }}</a-descriptions-item>
               <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
@@ -308,7 +313,8 @@ export default {
       },
       basicInfoData: null, // 基本信息
       openGuideModal: false, //  导入产品引导
-      rowSelectionInfo: null
+      rowSelectionInfo: null,
+      allocateTypeVal: []
     }
   },
   computed: {
@@ -419,8 +425,17 @@ export default {
       _this.editRemark = false
     },
     // 修改调拨类型
-    changeAllocateType (val) {
+    changeAllocateType (val, opt) {
+      console.log(val, opt, '------------')
       const _this = this
+      this.allocateTypeVal = val
+      this.basicInfoData.costTypeSn = val[0] ? val[0] : ''
+      this.basicInfoData.allocateSortSn = val[1] ? val[1] : ''
+      this.basicInfoData.allocateReturnTypeSn = val[2] ? val[2] : ''
+      // 名称
+      this.basicInfoData.costTypeName = opt[0] ? opt[0].name : ''
+      this.basicInfoData.allocateSortName = opt[1] ? opt[1].name : ''
+      this.basicInfoData.allocateReturnTypeName = opt[2] ? opt[2].name : ''
       this.$confirm({
         title: '提示',
         content: '确定要更改调拨退货类型吗?',
@@ -560,6 +575,9 @@ export default {
       allocateReturnQueryBySn({ allocateReturnSn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
           this.basicInfoData = res.data
+          if (this.basicInfoData.costTypeSn) {
+            this.allocateTypeVal = [this.basicInfoData.costTypeSn, this.basicInfoData.allocateSortSn, this.basicInfoData.allocateReturnTypeSn]
+          }
           if (!flag) {
             this.resetSearchForm()
           }

+ 25 - 4
src/views/allocationManagement/transferReturn/list.vue

@@ -21,8 +21,8 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨退货类型">
-                <AllocateType id="transferReturn-allocateReturnTypeSn" v-model="queryParam.allocateReturnTypeSn"></AllocateType>
+              <a-form-item label="费用/调拨退货类型">
+                <AllocateType id="transferReturn-allocateReturnTypeSn" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨退货类型" @change="changeAllocatype"></AllocateType>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -80,6 +80,14 @@
           <span v-if="$hasPermissions('M_transferReturnDetail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateReturnNo }}</span>
           <span v-else>{{ record.allocateReturnNo }}</span>
         </template>
+        <!-- 调拨类型 -->
+        <template slot="allocateType" slot-scope="text, record">
+          <div>
+            <span v-if="record.allocateSortName">{{ record.allocateSortName }}</span>
+            <span v-if="record.allocateSortName&&record.allocateReturnTypeName">/</span>
+            <span v-if="record.allocateReturnTypeName">{{ record.allocateReturnTypeName }}</span>
+          </div>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -146,13 +154,16 @@ export default {
         // moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         // moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
+      allocateTypeVal: [],
       queryParam: { //  查询条件
         // beginDate: getDate.getThreeMonthDays().starttime,
         // endDate: getDate.getCurrMonthDays().endtime,
         beginDate: '',
         endDate: '',
         targetName: '', //  调往对象
-        allocateReturnTypeSn: undefined, //  调拨退货类型
+        costTypeSn: undefined, // 费用类型
+        allocateSortSn: undefined, //  调拨类别
+        allocateReturnTypeSn: undefined, // 调拨退货类型2
         state: undefined, //  业务状态
         allocateReturnNo: '' //  调拨单号
       },
@@ -190,7 +201,8 @@ export default {
         { title: '调拨退货单号', scopedSlots: { customRender: 'allocateReturnNo' }, align: 'center', width: '8%' },
         { title: '调拨退货对象类型', dataIndex: 'targetTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调拨退货对象名称', dataIndex: 'targetName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调拨退货类型', dataIndex: 'allocateReturnTypeName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用类型', dataIndex: 'costTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨退货类型', scopedSlots: { customRender: 'allocateType' }, width: '6%', align: 'center' },
         { title: '是否抓单', dataIndex: 'grabFlagDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '退货总数量', dataIndex: 'totalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'totalBadQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -209,6 +221,12 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    changeAllocatype (val, opts) {
+      this.allocateTypeVal = val || []
+      this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
+      this.queryParam.allocateSortSn = val && val[1] ? val[1] : ''
+      this.queryParam.allocateReturnTypeSn = val && val[2] ? val[2] : ''
+    },
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate('')
@@ -219,7 +237,10 @@ export default {
       this.queryParam.targetName = ''
       this.queryParam.state = undefined
       this.queryParam.allocateReturnNo = ''
+      this.queryParam.costTypeSn = undefined
+      this.queryParam.allocateSortSn = undefined
       this.queryParam.allocateReturnTypeSn = undefined
+      this.allocateTypeVal = []
       this.$refs.table.refresh(true)
     },
     //  删除

+ 4 - 0
src/views/allocationManagement/transferReturn/print.vue

@@ -73,6 +73,10 @@ export default {
         allocateReturnSn: obj.allocateReturnSn || '',
         printType: obj.printType
       }
+      // 打印货位编号
+      if (obj.orderBy) {
+        params.orderBy = obj.orderBy
+      }
       _this.$emit('loading')
       printFun(allocateReturnPrint, params, obj.isPreview, '调拨退货单', () => { _this.$emit('unloading') })
     },

+ 14 - 2
src/views/allocationManagement/transferReturn/printModal.vue

@@ -26,6 +26,13 @@
             <a-radio value="bdy">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <a-form-model-item label="货位编号" prop="orderBy">
+          <a-radio-group v-model="form.orderBy">
+            <a-radio value="ASC">打印(↑升序)</a-radio>
+            <a-radio value="DESC">打印(↓降序)</a-radio>
+            <a-radio value="-1">不打印</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
         <a-button id="allocateBill-print-save" @click="handleSave(0)">取消</a-button>
@@ -58,10 +65,12 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       form: {
         id: 'all',
-        priceType: undefined
+        priceType: undefined,
+        orderBy: undefined
       },
       rules: {
-        priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }]
+        priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }],
+        orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }]
       },
       formItemLayout: {
         labelCol: { span: 6 },
@@ -87,6 +96,9 @@ export default {
               printType: _this.form.priceType,
               isPreview: this.nowType
             }
+            if (_this.form.orderBy != '-1') {
+              obj.orderBy = _this.form.orderBy
+            }
             _this.$emit('ok', obj)
           }
           _this.isShow = false

+ 1 - 10
src/views/allocationManagement/transfersPrint/list.vue

@@ -24,11 +24,6 @@
                   <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-item label="调拨类型">
-                  <AllocateType id="allocateBillList-allocateTypeSn" v-model="queryParam.allocateTypeSn"></AllocateType>
-                </a-form-item>
-              </a-col>
               <template v-if="advanced">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="收货客户名称">
@@ -157,12 +152,11 @@ import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import printModal from '@/views/allocationManagement/transferOut/printModal.vue'
 import recordModal from './recordModal.vue'
 import { allocateBillList, allocateBillDetailPrint } from '@/api/allocateBill'
-import AllocateType from '@/views/common/allocateType.js'
 import { printFun } from '@/libs/JGPrint.js'
 export default {
   name: 'TransfersPrintList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, AllocateType, dealerSubareaScopeList, printModal, recordModal, subarea, Area },
+  components: { STable, VSelect, rangeDate, dealerSubareaScopeList, printModal, recordModal, subarea, Area },
   data () {
     return {
       spinning: false,
@@ -178,7 +172,6 @@ export default {
         beginDate: getDate.getThreeMonthDays().starttime,
         endDate: getDate.getCurrMonthDays().endtime,
         targetName: '', //  调往对象
-        allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
         receiverSn: undefined,
@@ -228,7 +221,6 @@ export default {
         // { title: '易损件售价', dataIndex: 'receiveYsjTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '电池售价', dataIndex: 'receiveDcTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '机油售价', dataIndex: 'receiveJyTotalAmount', width: '70px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调拨类型', dataIndex: 'allocateTypeName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印状态', dataIndex: 'printStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '允许打印时间', dataIndex: 'allowPrintTime', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -263,7 +255,6 @@ export default {
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.targetName = ''
-      this.queryParam.allocateTypeSn = undefined
       this.queryParam.state = undefined
       this.queryParam.allocateNo = ''
       this.queryParam.receiverName = ''

+ 15 - 9
src/views/basicData/transferTypeManagement/editModal.vue

@@ -20,7 +20,7 @@
           :wrapper-col="formItemLayout.wrapperCol"
         >
           <a-form-model-item label="调拨类别" prop="allocateCategory">
-            <v-select code="ALLOCATE_CATEGORY" id="transferTypeManagementEdit-allocateCategory" v-model="form.allocateCategory" allowClear placeholder="请选择调拨类别"></v-select>
+            <allocateType id="transferTypeManagementEdit-allocateCategory" v-model="allocateType" @change="changeCategory" :level="2" placeholder="请选择调拨类别"></allocateType>
           </a-form-model-item>
           <a-form-model-item label="调拨类型名称" prop="name">
             <a-input
@@ -45,10 +45,11 @@
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
 import { allocateTypeSave } from '@/api/allocateType'
+import allocateType from '@/views/common/allocateType'
 export default {
   name: 'TransferTypeManagementEditModal',
   mixins: [commonMixin],
-  components: { VSelect },
+  components: { VSelect, allocateType },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -72,21 +73,22 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
-      detailsData: null, //  品牌数据
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
+      allocateType: [],
       form: {
         name: '', // 调拨类型名称
-        allocateCategory: undefined //  调拨类别
+        allocateCategory: undefined, //  调拨类别
+        treeLevel: 3
       },
       rules: {
-        name: [
-          { required: true, message: '请输入调拨类型名称', trigger: 'blur' }
-        ],
         allocateCategory: [
           { required: true, message: '请选择调拨类别', trigger: 'change' }
+        ],
+        name: [
+          { required: true, message: '请输入调拨类型名称', trigger: 'change' }
         ]
       }
     }
@@ -99,6 +101,9 @@ export default {
       str = str.replace(/[\r\n]/g, '')
       this.form.name = str
     },
+    changeCategory (v, opt) {
+      this.form.allocateCategory = v && v[1] ? v[1] : ''
+    },
     //  保存
     handleSave () {
       const _this = this
@@ -117,7 +122,6 @@ export default {
             }
           })
         } else {
-          console.log('error submit!!')
           return false
         }
       })
@@ -133,12 +137,14 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
+        this.allocateType = []
       }
     },
     itemSn (newValue, oldValue) {
       if (this.isShow && newValue) { //  编辑
         this.form.name = this.nowData && this.nowData.name ? this.nowData.name : ''
-        this.form.allocateCategory = this.nowData && this.nowData.allocateCategory ? this.nowData.allocateCategory : ''
+        this.form.allocateCategory = this.nowData && this.nowData.superior ? this.nowData.superior.allocateTypeSn : ''
+        this.allocateType = [this.nowData.superior.superior.allocateTypeSn, this.form.allocateCategory]
       } else { //  添加
         this.form.name = ''
         this.form.allocateCategory = undefined

+ 3 - 2
src/views/basicData/transferTypeManagement/list.vue

@@ -63,8 +63,9 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨类别', dataIndex: 'allocateCategoryDictValue', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨类型名称', dataIndex: 'name', align: 'center', width: '40%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '费用类型', dataIndex: 'superior.superior.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类别', dataIndex: 'superior.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类型名称', dataIndex: 'name', align: 'center', width: '25%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 54 - 17
src/views/common/allocateType.js

@@ -1,29 +1,38 @@
-import { allocateTypeAllList } from '@/api/allocateType'
+import { allocateTypeTreeList } from '@/api/allocateType'
 const AllocateType = {
   template: `
-      <a-select
-        placeholder="请选择调拨类型"
-        :id="id"
-        allowClear
+      <a-cascader
         :value="defaultVal"
-        :showSearch="true"
+        allowClear
+        :change-on-select="changeOnSelect"
         @change="handleChange"
-        option-filter-prop="children"
-        :filter-option="filterOption">
-        <a-select-option v-for="item in list" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-      </a-select>
+        :options="list"
+        expand-trigger="hover"
+        :placeholder="placeholder"
+        :id="id"
+        :fieldNames="{ label: 'name', value: 'allocateTypeSn', children: 'sonList' }"/>
     `,
   props: {
     value: {
-      type: String,
-      defatut: ''
+      type: Array,
+      defatut: function(){
+        return []
+      }
     },
     id: {
       type: String,
       default: ''
     },
-    sysFlag: {
+    placeholder:{
       type: String,
+      default: '请选择'
+    },
+    changeOnSelect:{
+      type: Boolean,
+      default: false
+    },
+    level:{
+      type: [String,Number],
       default: ''
     }
   },
@@ -47,21 +56,49 @@ const AllocateType = {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
-    handleChange(value) {
+    handleChange(value,opts) {
       this.defaultVal = value;
-      this.$emit('change', value);
       this.$emit('input', value);
+      this.$emit('change', value,opts);
     },
     //  调拨类型
     getProductBrand () {
-      allocateTypeAllList().then(res => {
+      allocateTypeTreeList({}).then(res => {
         if (res.status == 200) {
-          this.list = res.data
+          if(this.level){
+            this.list = this.getBylevel(res.data)
+          }else{
+            this.list = res.data
+          }
         } else {
           this.list = []
         }
       })
     },
+    getBylevel(data){
+      const ret = []
+      // 显示一级分类
+      if(this.level == 1){
+        data.map(item => {
+          if(item.sonList){
+            delete item.sonList
+          }
+        })
+      }
+      // 显示二级分类
+      if(this.level == 2){
+        data.map(item => {
+          if(item.sonList){
+            item.sonList.map(cd => {
+              if(cd.sonList){
+                 delete cd.sonList
+              }
+            })
+          }
+        })
+      }
+      return data
+    }
   },
 };
 

+ 72 - 0
src/views/common/allocateTypeByLevel.js

@@ -0,0 +1,72 @@
+import { queryListByTreeLevel } from '@/api/allocateType'
+const AllocateTypeByLevel = {
+  template: `
+      <a-select
+        :placeholder="placeholder"
+        :id="id"
+        allowClear
+        :value="defaultVal"
+        :showSearch="true"
+        @change="handleChange"
+        option-filter-prop="children"
+        :filter-option="filterOption">
+        <a-select-option v-for="item in list" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
+      </a-select>
+    `,
+  props: {
+    value: {
+      type: [String,Number],
+      defatut: ''
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    level: {
+      type: [String,Number],
+      default: '3'
+    },
+    placeholder:{
+      type: String,
+      default: '请选择'
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value,
+      list: []
+    };
+  },
+  mounted() {
+    this.getProductBrand()
+  },
+  watch: {
+    value(newValue, oldValue) {
+      this.defaultVal = newValue
+    }
+  },
+  methods: {
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    handleChange(value) {
+      this.defaultVal = value;
+      this.$emit('input', value);
+      this.$emit('change', value);
+    },
+    //  调拨类型
+    getProductBrand () {
+      queryListByTreeLevel({"treeLevel":this.level}).then(res => {
+        if (res.status == 200) {
+          this.list = res.data
+        } else {
+          this.list = []
+        }
+      })
+    },
+  },
+};
+
+export default AllocateTypeByLevel

+ 16 - 8
src/views/common/custList.vue

@@ -80,14 +80,22 @@ export default {
       })
     },
     handleChange (value) {
-      const row = this.data.filter(item => item.dealerSn == value.key)
-      Object.assign(this, {
-        dealerName: value,
-        data: [],
-        fetching: false
-      })
-      this.$emit('change', value || { key: undefined }, row[0], this.id)
-      // this.$emit('input', value.key)
+      console.log(value)
+      if (value) {
+        const row = this.data.filter(item => item.dealerSn == value.key)
+        Object.assign(this, {
+          dealerName: value,
+          data: [],
+          fetching: false
+        })
+        this.$emit('change', value || { key: undefined }, row[0], this.id)
+        // this.$emit('input', value.key)
+      } else {
+        this.setDufaultVal('')
+        this.resetForm()
+        this.$emit('change', value || { key: undefined }, undefined, this.id)
+        // this.$emit('input', value.key)
+      }
     },
     resetForm () {
       this.dealerName = []

+ 73 - 0
src/views/common/expenseType.js

@@ -0,0 +1,73 @@
+import { expenseTypeList } from '@/api/expenseManagement.js'
+const ExpenseType = {
+  template: `
+      <a-cascader
+        :value="defaultVal"
+        allowClear
+        :change-on-select="changeOnSelect"
+        @change="handleChange"
+        :options="list"
+        expand-trigger="hover"
+        :placeholder="placeholder"
+        :id="id"
+        :fieldNames="{ label: 'name', value: 'expenseTypeSn', children: 'sonList' }"/>
+    `,
+  props: {
+    value: {
+      type: Array,
+      defatut: function(){
+        return []
+      }
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    placeholder:{
+      type: String,
+      default: '请选择'
+    },
+    changeOnSelect:{
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value,
+      list: []
+    };
+  },
+  mounted() {
+    this.getProductBrand()
+  },
+  watch: {
+    value(newValue, oldValue) {
+      this.defaultVal = newValue
+    }
+  },
+  methods: {
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    handleChange(value,opts) {
+      this.defaultVal = value;
+      this.$emit('input', value);
+      this.$emit('change', value, opts);
+    },
+    //  调拨类型
+    getProductBrand () {
+      expenseTypeList({}).then(res => {
+        if (res.status == 200) {
+          this.list = res.data
+        } else {
+          this.list = []
+        }
+      })
+    },
+  },
+};
+
+export default ExpenseType

+ 78 - 0
src/views/common/months.js

@@ -0,0 +1,78 @@
+const Months = {
+  template: `
+      <a-select
+        :placeholder="placeholder"
+        :id="id"
+        allowClear
+        :value="defaultVal"
+        :showSearch="true"
+        :mode="mode"
+        :disabled="disabled"
+        :maxTagCount="2"
+        @change="handleChange"
+        option-filter-prop="children"
+        :filter-option="filterOption">
+        <a-select-option v-for="item in monthList" :key="item.val" :value="item.val" :disabled="item.disabled">{{ item.name }}</a-select-option>
+      </a-select>
+    `,
+  props: {
+    value: {
+      type: [String,Array],
+      defatut: ''
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    mode: {
+      type: String,
+      default: 'default'
+    },
+    disabled: {
+      type: Boolean,
+      default: false
+    },
+    placeholder:{
+      type: String,
+      default: '请选择月份'
+    }
+  },
+  data() {
+    return {
+      defaultVal: this.value,
+      monthList: []
+    };
+  },
+  mounted() {
+    const year = new Date().getFullYear()
+    const curMonth = new Date().getMonth()
+    const m = ['一','二','三','四','五','六','七','八','九','十','十一','十二']
+    for(let i=1;i<=12;i++){
+      this.monthList.push({
+        val: year +"-" + (i<10?'0'+i:i),
+        name: year + '年' + (i<10?'0'+i:i) + '月',
+        disabled: (i-1)>curMonth
+      })
+    }
+  },
+  watch: {
+    value(newValue, oldValue) {
+      this.defaultVal = newValue
+    },
+  },
+  methods: {
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    handleChange(value) {
+      this.defaultVal = value;
+      const row = this.monthList.find(item => item.val == value)
+      this.$emit('input', value);
+      this.$emit('change', value, this.id, row);
+    },
+  },
+};
+
+export default Months

+ 6 - 2
src/views/common/productBrand.js

@@ -2,7 +2,7 @@ import { productBrandQuery } from '@/api/productBrand'
 const ProductBrand = {
   template: `
       <a-select
-        placeholder="请选择产品品牌"
+        :placeholder="placeholder"
         :id="id"
         allowClear
         :value="defaultVal"
@@ -23,6 +23,10 @@ const ProductBrand = {
       type: String,
       default: ''
     },
+    placeholder:{
+      type: String,
+      default: '请选择产品品牌'
+    },
     sysFlag: {
       type: String,
       default: ''
@@ -63,8 +67,8 @@ const ProductBrand = {
     handleChange(value) {
       this.defaultVal = value;
       const row = this.productBrandList.find(item => item.brandSn == value)
-      this.$emit('change', value, this.id, row);
       this.$emit('input', value);
+      this.$emit('change', value, this.id, row);
     },
     //  产品品牌列表, sysFlag: 1 箭冠 0 自建
     getProductBrand () {

+ 39 - 2
src/views/common/productType.js

@@ -7,6 +7,7 @@ const ProductType = {
         :value="defaultVal"
         expand-trigger="hover"
         :options="productTypeList"
+        :show-search="{ filter }"
         :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
         :id="id"
         placeholder="请选择产品分类"
@@ -22,7 +23,11 @@ const ProductType = {
     id: {
       type: String,
       default: ''
-    }
+    },
+    level: {
+      type: [String,Number],
+      default: ''
+    },
   },
   data () {
     return {
@@ -39,6 +44,10 @@ const ProductType = {
     this.getProductType()
   },
   methods: {
+    filter(inputValue, path) {
+      console.log(inputValue, path)
+      return path.some(option => option.productTypeName.indexOf(inputValue) > -1);
+    },
     setDefValue(defaultVal){
       this.handleChange(defaultVal)
     },
@@ -51,11 +60,39 @@ const ProductType = {
     getProductType () {
       productTypeQuery({}).then(res => {
         if (res.status == 200) {
-          this.productTypeList = res.data
+          if(this.level){
+            this.productTypeList = this.getBylevel(res.data)
+          }else{
+            this.productTypeList = res.data
+          }
         } else {
           this.productTypeList = []
         }
       })
+    },
+    getBylevel(data){
+      const ret = []
+      // 显示一级分类
+      if(this.level == 1){
+        data.map(item => {
+          if(item.children){
+            delete item.children
+          }
+        })
+      }
+      // 显示二级分类
+      if(this.level == 2){
+        data.map(item => {
+          if(item.children){
+            item.children.map(cd => {
+              if(cd.children){
+                 delete cd.children
+              }
+            })
+          }
+        })
+      }
+      return data
     }
   }
 }

+ 10 - 1
src/views/common/productTypeAll.js

@@ -8,9 +8,10 @@ const ProductType = {
         expand-trigger="hover"
         :options="productTypeList"
         :disabled="disabled"
+        :show-search="{ filter }"
         :fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
         :id="id"
-        placeholder="请选择产品分类"
+        :placeholder="placeholder"
         allowClear />
     `,
   props: {
@@ -20,6 +21,10 @@ const ProductType = {
         return []
       }
     },
+    placeholder:{
+      type: String,
+      default: '请选择产品分类'
+    },
     id: {
       type: String,
       default: ''
@@ -44,6 +49,10 @@ const ProductType = {
     this.getProductType()
   },
   methods: {
+    filter(inputValue, path) {
+      console.log(inputValue, path)
+      return path.some(option => option.productTypeName.indexOf(inputValue) > -1);
+    },
     setDefValue(defaultVal){
       this.handleChange(defaultVal)
     },

+ 40 - 7
src/views/expenseManagement/expenseReimbursement/add.vue

@@ -16,7 +16,7 @@
             <a-descriptions-item label="费用单号">{{ detailData&&detailData.expenseAccountNo || '--' }}</a-descriptions-item>
             <a-descriptions-item label="申请人">{{ detailData&&detailData.applyPersonName || '--' }}</a-descriptions-item>
             <a-descriptions-item label="申请部门">{{ detailData&&detailData.applyDepartmentName || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="费用类型">{{ detailData&&detailData.expenseTypeDictValue || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="费用类型">{{ detailData&&detailData.expenseTypeName || '--' }}<span v-if="detailData&&detailData.expenseType2">/{{ detailData&&detailData.expenseTypeName2 || '--' }}</span></a-descriptions-item>
             <a-descriptions-item label="费用发生月份">{{ detailData&&detailData.expenseDate?detailData.expenseDate.substring(0, 7) : '--' }}</a-descriptions-item>
             <a-descriptions-item label="合计金额">{{ (detailData.applyExpenseTotal || detailData.applyExpenseTotal == 0) ? detailData.applyExpenseTotal+' 元' : '--' }}</a-descriptions-item>
             <a-descriptions-item label="状态">{{ detailData&&detailData.stateDictValue || '--' }}</a-descriptions-item>
@@ -95,12 +95,17 @@
           </template>
           <!-- 产品信息 -->
           <template slot="cpxx" slot-scope="text,record">
-            <div v-for="item in record.detailProductsList" :key="item.id">
-              <div v-if="item.productCode">{{ item.productCode }}: ¥{{ item.expense }}</div>
-              <div v-else-if="item.productBrandName">{{ item.productBrandName }}<span v-if="item.productTypeShowName">/</span>{{ item.productTypeShowName }}: ¥{{ item.expense }}</div>
-              <div v-else>{{ item.productTypeShowName }}: ¥{{ item.expense }}</div>
+            <div style="display:flex;align-items: center;" v-if="record.detailProductsList">
+              <a-icon style="color:red;font-size:16px;" v-if="record.ptaFlag" type="exclamation-circle" />
+              <div style="padding-left: 6px;">
+                <div v-for="item in record.detailProductsList" :key="item.id">
+                  <div v-if="item.productCode">{{ item.productCode }}: <span :style="{color:record.ptaFlag?'red':''}">¥{{ item.expense }}</span></div>
+                  <div v-else-if="item.productBrandName">{{ item.productBrandName }}<span v-if="item.productTypeShowName">/</span>{{ item.productTypeShowName }}: <span :style="{color:record.ptaFlag?'red':''}">¥{{ item.expense }}</span></div>
+                  <div v-else>{{ item.productTypeShowName }}: <span :style="{color:record.ptaFlag?'red':''}">¥{{ item.expense }}</span></div>
+                </div>
+              </div>
             </div>
-            <span v-if="!record.detailProductsList||record.detailProductsList.length==0">--</span>
+            <div v-else>--</div>
           </template>
         </s-table>
       </a-card>
@@ -165,6 +170,7 @@ export default {
       expenseAccountDetailSn: '',
       openProductInfoModal: false, // 产品信息弹框
       total: 0,
+      hasPtaFlag: [],
       loadData: parameter => {
         const params = Object.assign(parameter, { expenseAccountSn: this.$route.params.sn })
         return expenseAcctDetailFindList(params).then(res => {
@@ -172,8 +178,20 @@ export default {
           if (res.status == 200) {
             data = res.data
             const no = 0
+            this.hasPtaFlag = []
             for (var i = 0; i < data.length; i++) {
               data[i].no = no + i + 1
+              // 产品信息合计
+              if (data[i].detailProductsList) {
+                data[i].productTotalAmount = 0
+                data[i].detailProductsList.map(item => {
+                  data[i].productTotalAmount += item.expense
+                })
+                data[i].ptaFlag = Math.floor(data[i].productTotalAmount) !== Math.abs(data[i].expense)
+                if (data[i].ptaFlag) {
+                  this.hasPtaFlag.push('第 ' + (i + 1) + ' 行')
+                }
+              }
             }
             this.total = data.length
             this.disabled = false
@@ -287,7 +305,22 @@ export default {
     },
     beforeSubmit () {
       if (this.total) {
-        this.openDepartUserModal = true
+        // 判断是否存在产品信息合计不等于记账费用
+        if (this.hasPtaFlag.length) {
+          const h = this.$createElement
+          this.$warning({
+            title: '操作提示',
+            content: h('div', {}, [
+              h('p', '提交失败,以下费用明细的产品信息金额之和,不等于记账费用,请修改后再提交!'),
+              h('p', '需要修改的行数:'),
+              h('p', { style: { color: '#00aaff' } }, this.hasPtaFlag.join(','))
+            ]),
+            centered: true,
+            onOk () {}
+          })
+        } else {
+          this.openDepartUserModal = true
+        }
       } else {
         this.$message.info('请新增费用明细')
       }

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

@@ -29,13 +29,12 @@
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="费用类型" prop="expenseType">
-              <v-select
-                code="EXPENSE_TYPE"
+              <expenseType
                 id="expenseReimbursement-expenseType"
-                v-model="form.expenseType"
-                allowClear
+                v-model="expenseTypes"
+                @change="expenseChange"
                 placeholder="请选择费用类型"
-              ></v-select>
+              ></expenseType>
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
@@ -104,10 +103,11 @@ import { VSelect, Upload, STable } from '@/components'
 import moment from 'moment'
 import department from './department.js'
 import employee from './employee.js'
+import expenseType from '@/views/common/expenseType.js'
 import { expenseAccountDetail, expenseAccountSave } from '@/api/expenseManagement.js'
 export default {
   name: 'BaseDataModal',
-  components: { VSelect, Upload, STable, department, employee },
+  components: { VSelect, Upload, STable, department, employee, expenseType },
   props: {
     show: [Boolean],
     itemSn: {
@@ -127,10 +127,14 @@ export default {
       },
       attachList: [],
       attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
+      expenseTypes: [],
       form: {
         applyPersonSn: undefined, // 申请人
         applyDepartmentSn: undefined, //  申请部门
-        expenseType: undefined, //  费用类型
+        expenseType: undefined, //  费用类型1
+        expenseType2: undefined, //  费用类型2
+        expenseTypeName: undefined, //  费用类型1
+        expenseTypeName2: undefined, //  费用类型2
         expenseDate: moment().locale('zh-cn').format('YYYY-MM'), //  费用产生月
         title: '', // 主题
         content: '' // 费用说明
@@ -167,6 +171,7 @@ export default {
         this.form.expenseAccountFilesList = ''
         this.$refs.attachList.setFileList('')
         this.$refs.ruleForm.resetFields()
+        this.expenseTypes = []
         if (this.expenseAccountSn) { //  编辑页
           this.getDetail()
           this.title = '编辑费用报销单'
@@ -193,6 +198,15 @@ export default {
     disabledDate (current) {
       return current && current > moment().endOf('day')
     },
+    expenseChange (val, opts) {
+      console.log(val, opts)
+      this.expenseTypes = val || []
+      this.form.expenseType = val && val[0] ? val[0] : ''
+      this.form.expenseType2 = val && val[1] ? val[1] : ''
+      // 名称
+      this.form.expenseTypeName = opts && opts[0] ? opts[0].name : ''
+      this.form.expenseTypeName2 = opts && opts[1] ? opts[1].name : ''
+    },
     //  附件上传
     changeAttach (file) {
       this.attachList = JSON.parse(file)
@@ -212,6 +226,11 @@ export default {
           this.form.expenseAccountFilesList = ''
           this.attachList = res.data.expenseAccountFilesList
           this.$refs.attachList.setFileList(this.attachList)
+          if (this.form.expenseType) {
+            this.expenseTypes = [this.form.expenseType, this.form.expenseType2]
+          } else {
+            this.expenseTypes = []
+          }
         } else {
           this.$refs.ruleForm.resetFields()
         }

+ 1 - 1
src/views/expenseManagement/expenseReimbursement/department.js

@@ -53,8 +53,8 @@ const Department = {
     },
     handleChange(value) {
       this.defaultVal = value;
-      this.$emit('change', value);
       this.$emit('input', value);
+      this.$emit('change', value);
     },
     getList () {
       departmentQueryList({}).then(res => {

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

@@ -35,7 +35,7 @@
               <a-descriptions-item label="费用单号">{{ detailData&&detailData.expenseAccountNo || '--' }}</a-descriptions-item>
               <a-descriptions-item label="申请人">{{ detailData&&detailData.applyPersonName || '--' }}</a-descriptions-item>
               <a-descriptions-item label="申请部门">{{ detailData&&detailData.applyDepartmentName || '--' }}</a-descriptions-item>
-              <a-descriptions-item label="费用类型">{{ detailData&&detailData.expenseTypeDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="费用类型">{{ detailData&&detailData.expenseTypeName || '--' }}<span v-if="detailData&&detailData.expenseType2">/{{ detailData&&detailData.expenseTypeName2 || '--' }}</span></a-descriptions-item>
               <a-descriptions-item label="费用发生月份">{{ detailData&&detailData.expenseDate?detailData.expenseDate.substring(0, 7) : '--' }}</a-descriptions-item>
               <a-descriptions-item label="合计金额">{{ (detailData.applyExpenseTotal || detailData.applyExpenseTotal == 0) ? detailData.applyExpenseTotal+' 元' : '--' }}</a-descriptions-item>
               <a-descriptions-item label="状态">{{ detailData&&detailData.stateDictValue || '--' }}</a-descriptions-item>

+ 23 - 7
src/views/expenseManagement/expenseReimbursement/epenseDetailModal.vue

@@ -52,7 +52,6 @@
                   <subarea
                     id="epenseDetailModal-subarea"
                     ref="subareaBox"
-                    mode="multiple"
                     @change="subareaChange"
                     placeholder="请选择所属区域"
                     v-model="form.subareaSnList"></subarea>
@@ -183,16 +182,25 @@ export default {
     accountNameSnChange (v, row) {
       console.log(v, row)
       if (this.form.accountType == 'CUSTOMER') {
-        this.form.accountNameSn = v.key
         if (row) {
+          this.form.accountNameSn = v.key
           this.form.provinceSn = row.provinceSn
           this.form.citySn = row.citySn
           this.form.provinceName = row.provinceName
           this.form.cityName = row.cityName
           if (row.subareaNameSet) {
-            this.form.subareaNameList = row.subareaNameSet
-            this.form.subareaSnList = this.$refs.subareaBox.getValByName(row.subareaNameSet)
+            const a = row.subareaNameSet.filter(item => item !== '中国')
+            this.form.subareaNameList = [a[0]]
+            this.form.subareaSnList = [this.$refs.subareaBox.getValByName(this.form.subareaNameList)[0]]
           }
+        } else {
+          this.form.accountNameSn = ''
+          this.form.provinceSn = ''
+          this.form.citySn = ''
+          this.form.provinceName = ''
+          this.form.cityName = ''
+          this.form.subareaNameList = ''
+          this.form.subareaSnList = ''
         }
       }
       this.$nextTick(() => {
@@ -202,6 +210,7 @@ export default {
     // 分区
     subareaChange (v, row) {
       const arr = []
+      console.log(v, row)
       row.map(item => arr.push(item.subareaName))
       this.form.subareaNameList = arr
     },
@@ -248,21 +257,24 @@ export default {
           if (cdfList[0] == 1) {
             this.$warning({
               title: '是否存在以下情况,请按照要求填写',
-              content: <div><p>1、费用承担方至少有一个</p><p>2、带星号的列为必填项,不能为空</p></div>
+              content: <div><p>1、费用承担方至少有一个</p><p>2、带星号的列为必填项,不能为空</p></div>,
+              centered: true
             })
             return
           }
           if (cdfList[0] == 3) {
             this.$warning({
               title: '提示',
-              content: '请检查每行承担人员是否已经选择'
+              content: '请检查每行承担人员是否已经选择',
+              centered: true
             })
             return
           }
           if (cdfList[0] == 2) {
             this.$warning({
               title: '提示',
-              content: '请检查每行人员平摊费用合计是否等于承担金额'
+              content: '请检查每行人员平摊费用合计是否等于承担金额',
+              centered: true
             })
             return
           }
@@ -273,6 +285,10 @@ export default {
           form.citySn = form.citySn ? form.citySn : ''
           form.cityName = form.cityName ? form.cityName : ''
           form.expense = Math.abs(form.expense)
+          // 不是数组
+          if (!Array.isArray(form.subareaSnList)) {
+            form.subareaSnList = [form.subareaSnList]
+          }
           console.log(form)
           delete form.subareaNames
           delete form.subareaSns

+ 1 - 1
src/views/expenseManagement/expenseReimbursement/importGuideModal.vue

@@ -129,7 +129,7 @@ export default {
     handleExport () {
       const link = document.createElement('a')
       link.style.display = 'none'
-      link.href = 'https://jg-ocs.oss-cn-beijing.aliyuncs.com/templ/promo/expenseAccountDetailImport.xlsx'
+      link.href = 'https://jg-ocs.oss-cn-beijing.aliyuncs.com/templ/promo/expenseAccountDetailImport.xlsx?t=' + new Date().getTime()
       link.setAttribute('download', '费用明细模板' + '.xlsx')
       document.body.appendChild(link)
       link.click()

+ 22 - 7
src/views/expenseManagement/expenseReimbursement/list.vue

@@ -17,13 +17,13 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="费用类型">
-                <v-select
-                  v-model="queryParam.expenseType"
-                  ref="expenseType"
+                <expenseType
                   id="salesManagementList-expenseType"
-                  code="EXPENSE_TYPE"
+                  :changeOnSelect="true"
+                  v-model="expenseTypes"
+                  @change="expenseChange"
                   placeholder="请选择费用类型"
-                  allowClear></v-select>
+                ></expenseType>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -93,6 +93,10 @@
         <template slot="totalQty" slot-scope="text, record">
           {{ record.totalQty }}
         </template>
+        <!-- 费用类型 -->
+        <template slot="expenseType" slot-scope="text, record">
+          <div>{{ record.expenseTypeName || '--' }}<span v-if="record.expenseType2">/{{ record.expenseTypeName2 || '--' }}</span></div>
+        </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
           <a-button
@@ -150,12 +154,13 @@ import subarea from '@/views/common/subarea.js'
 import employee from './employee.js'
 import { STable, VSelect } from '@/components'
 import verifyModal from './verifyModal.vue'
+import expenseType from '@/views/common/expenseType.js'
 import { expenseAccountList, expenseAccountDelete, expenseAccountAgainEdit } from '@/api/expenseManagement'
 import baseDataModal from './baseDataModal.vue'
 export default {
   name: 'ExpenseReimbursementList',
   mixins: [commonMixin],
-  components: { STable, VSelect, subarea, verifyModal, baseDataModal, employee },
+  components: { STable, VSelect, subarea, verifyModal, baseDataModal, employee, expenseType },
   data () {
     return {
       locale,
@@ -166,12 +171,14 @@ export default {
       openBaseModal: false, // 基础信息新建
       itemSn: '', // 费用单sn
       tableHeight: 0,
+      expenseTypes: [],
       // 查询参数
       queryParam: {
         expenseDate: moment().format('YYYY-MM'), // 月份
         expenseAccountNo: '', // 费用单号
         title: '', //  主题
         expenseType: undefined, // 费用类型
+        expenseType2: undefined, // 费用类型2
         state: undefined // 状态
       },
       // 加载数据方法 必须为 Promise 对象
@@ -202,7 +209,7 @@ export default {
         { title: '费用单号', width: '12%', align: 'center', scopedSlots: { customRender: 'expenseAccountNo' } },
         { title: '申请人', dataIndex: 'applyPersonName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '申请部门', dataIndex: 'applyDepartmentName', width: '8%', align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '费用类型', dataIndex: 'expenseTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用类型', scopedSlots: { customRender: 'expenseType' }, width: '6%', align: 'center' },
         { title: '费用发生月份', dataIndex: 'expenseDate', width: '6%', align: 'center', customRender: function (text) { return moment(text).format('YYYY年MM月') || '--' } },
         { title: '主题', dataIndex: 'title', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '合计金额', dataIndex: 'applyExpenseTotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -219,6 +226,12 @@ export default {
     disabledDate (current) {
       return current && current > moment().endOf('day')
     },
+    expenseChange (val, opts) {
+      console.log(val, opts)
+      this.expenseTypes = val || []
+      this.queryParam.expenseType = val && val[0] ? val[0] : ''
+      this.queryParam.expenseType2 = val && val[1] ? val[1] : ''
+    },
     // 详情
     handleDetail (row) {
       this.$router.push({ name: 'expenseReimbursementListDetail', params: { sn: row.expenseAccountSn } })
@@ -285,9 +298,11 @@ export default {
         expenseAccountNo: '', // 费用单号
         title: '', //  主题
         expenseType: undefined, // 费用类型
+        expenseType2: undefined, // 费用类型2
         state: undefined, // 状态
         applyPersonSn: undefined
       }
+      this.expenseTypes = []
       this.$refs.table.refresh(true)
     },
     pageInit () {

+ 17 - 7
src/views/expenseManagement/expenseReimbursement/productInfoModal.vue

@@ -165,13 +165,21 @@ export default {
       console.log(val, id, options)
       const index = id.split('-')[1]
       const row = this.dataList[index]
-      row.productTypeSn1 = val[0] ? val[0] : ''
-      row.productTypeSn2 = val[1] ? val[1] : ''
-      row.productTypeSn3 = val[2] ? val[2] : ''
-      if (options) {
-        row.productTypeName1 = options[0] ? options[0].productTypeName : ''
-        row.productTypeName2 = options[1] ? options[1].productTypeName : ''
-        row.productTypeName3 = options[2] ? options[2].productTypeName : ''
+      if (val.length > 1) {
+        row.productTypeSn1 = val[0] ? val[0] : ''
+        row.productTypeSn2 = val[1] ? val[1] : ''
+        row.productTypeSn3 = val[2] ? val[2] : ''
+        if (options) {
+          row.productTypeName1 = options[0] ? options[0].productTypeName : ''
+          row.productTypeName2 = options[1] ? options[1].productTypeName : ''
+          row.productTypeName3 = options[2] ? options[2].productTypeName : ''
+        }
+      } else if (val.length == 1) {
+        this.$set(row, 'productType', [])
+        this.$nextTick(() => {
+          this.$refs['productType-' + row.no].setDefValue([])
+        })
+        this.$message.info('不能只选择一级分类')
       }
     },
     // 添加
@@ -256,6 +264,7 @@ export default {
     },
     // 查询详情
     getDetail () {
+      this.spinning = true
       expenseAcctDetailFindProductsBySn({ detailSn: this.expenseAccountDetailSn }).then(res => {
         if (res.data && res.data.length) {
           this.dataList = res.data
@@ -291,6 +300,7 @@ export default {
             'productTypeSn3': ''
           }]
         }
+        this.spinning = false
       })
     }
   },

+ 22 - 9
src/views/expenseManagement/expenseReimbursementDetail/list.vue

@@ -28,13 +28,13 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="费用类型">
-                  <v-select
-                    v-model="queryParam.expenseType"
-                    ref="expenseType"
+                  <expenseType
                     id="expenseReimbursementDetailList-expenseType"
-                    code="EXPENSE_TYPE"
+                    v-model="expenseTypes"
+                    :changeOnSelect="true"
+                    @change="expenseChange"
                     placeholder="请选择费用类型"
-                    allowClear></v-select>
+                  ></expenseType>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -168,7 +168,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ y: tableHeight,x:2010 }"
+        :scroll="{ y: tableHeight,x:2250 }"
         :defaultLoadData="false"
         bordered>
       </s-table>
@@ -189,13 +189,14 @@ import department from '../expenseReimbursement/department.js'
 import employee from '../expenseReimbursement/employee.js'
 import custList from '@/views/common/custList.vue'
 import supplier from '@/views/common/supplier.js'
+import expenseType from '@/views/common/expenseType.js'
 import { expenseAccountDetailList, expenseAcctDetailReport, expenseAccountDetailCount } from '@/api/expenseManagement'
 import { hdExportExcel } from '@/libs/exportExcel'
 moment.locale('zh-cn')
 export default {
   name: 'ExpenseReimbursementDetailList',
   mixins: [commonMixin],
-  components: { STable, VSelect, department, employee, subarea, rangeDate, Area, custList, supplier },
+  components: { STable, VSelect, department, employee, subarea, rangeDate, Area, custList, supplier, expenseType },
   data () {
     return {
       spinning: false,
@@ -209,6 +210,7 @@ export default {
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
       countData: null,
+      expenseTypes: [],
       // 查询参数
       queryParam: {
         expenseDate: undefined, // 月份
@@ -218,6 +220,7 @@ export default {
         applyPersonSn: undefined, // 申请人
         applyDepartmentSn: undefined, // 申请部门
         expenseType: undefined, //  费用类型
+        xpenseType2: undefined, //  费用类型
         accountType: undefined, // 记账类型
         accountNameSn: undefined, // 记账名称
         splitObjType: undefined, // 费用承担方类型
@@ -262,9 +265,11 @@ export default {
         { title: '费用单号', dataIndex: 'expenseAccountNo', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '申请人', dataIndex: 'applyPersonName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '申请部门', dataIndex: 'applyDepartmentName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '费用类型', dataIndex: 'expenseTypeDictValue', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用类型(一级)', dataIndex: 'expenseTypeName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用类型(二级)', dataIndex: 'expenseTypeName2', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '费用发生月份', dataIndex: 'expenseDate', width: 90, align: 'center', customRender: function (text) { return moment(text).format('YYYY年MM月') || '--' } },
         { title: '主题', dataIndex: 'title', align: 'center', width: 150, customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '详细说明', dataIndex: 'content', align: 'center', width: 150, customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '记账类型', dataIndex: 'accountTypeDictValue', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '记账名称', dataIndex: 'accountName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '财务编码', dataIndex: 'accountNameFnumber', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
@@ -289,6 +294,12 @@ export default {
     onChange (date, dateString) {
       this.queryParam.expenseDate = dateString
     },
+    expenseChange (val, opts) {
+      console.log(val, opts)
+      this.expenseTypes = val || []
+      this.queryParam.expenseType = val && val[0] ? val[0] : ''
+      this.queryParam.expenseType2 = val && val[1] ? val[1] : ''
+    },
     custChange (val) {
       this.queryParam.splitObjSn = val.key
     },
@@ -345,6 +356,7 @@ export default {
         applyPersonSn: undefined, // 申请人
         applyDepartmentSn: undefined, // 申请部门
         expenseType: undefined, //  费用类型
+        expenseType2: undefined, //  费用类型2
         accountType: undefined, // 记账类型
         accountNameSn: undefined, // 记账名称
         splitObjType: undefined, // 费用承担方类型
@@ -356,6 +368,7 @@ export default {
         provinceSn: undefined,
         citySn: undefined
       }
+      this.expenseTypes = []
       this.$refs.table.refresh(true)
     },
     pageInit () {
@@ -366,7 +379,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 195
+      this.tableHeight = window.innerHeight - tableSearchH - 215
     }
   },
   watch: {

+ 73 - 20
src/views/financialManagement/collectionDetailStatic/list.vue

@@ -27,8 +27,8 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="客户名称">
-                <dealerSubareaScopeList id="collectionDetail-Employee" ref="settleClientName" @change="custChange" />
+              <a-form-item label="付款方">
+                <a-input id="financialCollectionList-payerName" v-model.trim="queryParam.payerName" allowClear placeholder="请输入付款方"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -37,8 +37,8 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="营业执照名称">
-                <a-input id="collectionDetail-licenseName" placeholder="请输入营业执照名称" v-model="queryParam.licenseName"></a-input>
+              <a-form-item label="付款账户">
+                <a-input id="collectionDetail-payerAccountInfo" placeholder="请输入付款账户" v-model="queryParam.payerAccountInfo"></a-input>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -53,9 +53,17 @@
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
-              <a-col :md="4" :sm="24">
-                <a-form-item label="汇入银行">
-                  <a-select placeholder="请选择汇入银行" v-model="queryParam.bankName" style="width: 100%">
+              <a-col :md="3" :sm="24">
+                <a-form-item label="户名/汇入银行">
+                  <a-select placeholder="请选择户名" allowClear v-model="queryParam.bankAccount" style="width: 100%" @change="handleChange">
+                    <a-select-option v-for="item in bankList" :value="item.bankAccount">
+                      {{ item.bankAccount }}
+                    </a-select-option>
+                  </a-select>
+                </a-form-item></a-col>
+              <a-col :md="3" :sm="24">
+                <a-form-item>
+                  <a-select placeholder="请选择汇入银行" allowClear v-model="queryParam.bankName" style="width: 100%">
                     <a-select-option v-for="item in bankNameList" :value="item">
                       {{ item }}
                     </a-select-option>
@@ -92,6 +100,16 @@
             </a-col>
           </a-row>
         </a-form>
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            订单总金额:{{ countData&&countData.orderAmount||0 }}元;
+            收款总金额:{{ countData&&countData.receiptAmount||0 }}元;
+            使用授信总金额:{{ countData&&countData.useCreditAmount||0 }}元;
+            授信还款总金额:{{ countData&&countData.payCreditAmount||0 }}元;
+            余款抵扣总金额:{{ countData&&countData.balanceAmount||0 }}元;
+            跨月打款总金额:{{ countData&&countData.nextMonthAmount||0 }}元;
+          </div>
+        </a-alert>
       </div>
       <!-- 列表 -->
       <s-table
@@ -119,7 +137,7 @@ import Area from '@/views/common/area.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import employee from '../../expenseManagement/expenseReimbursement/employee.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
-import { financeBookDetailQueryPage, financeBookDetailExport } from '@/api/financeBook.js'
+import { financeBookDetailQueryPage, financeBookDetailExport, financeBookReportDetailCount } from '@/api/financeBook.js'
 export default {
   name: 'CollectionDetailStaticList',
   mixins: [commonMixin],
@@ -136,10 +154,11 @@ export default {
         receiptBeginDate: '',
         receiptEndDate: '',
         applyPersonSn: undefined,
-        dealerSn: undefined,
+        payerName: undefined,
         kdMidCustomerFnumber: '',
-        licenseName: '',
+        payerAccountInfo: '',
         fullPaymentFlag: undefined,
+        bankAccount: undefined,
         bankName: undefined,
         subareaSn: undefined,
         provinceSn: undefined
@@ -155,7 +174,8 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return financeBookDetailQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
+        const params = Object.assign(parameter, this.queryParam)
+        return financeBookDetailQueryPage(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -167,11 +187,31 @@ export default {
             this.disabled = false
           }
           this.spinning = false
+          this.getCount(params)
           return data
         })
       },
       total: 0, // 合计
-      bankNameList: ['东莞银行', '九江银行', '建设银行', '微信收款', '农业银行']
+      countData: null,
+      bankList: [
+        {
+          bankAccount: '张丽友',
+          bankName: ['建设银行', '微信收款']
+        },
+        {
+          bankAccount: '张丽添',
+          bankName: ['农业银行']
+        },
+        {
+          bankAccount: '东莞箭冠',
+          bankName: ['东莞银行']
+        },
+        {
+          bankAccount: '江西箭冠',
+          bankName: ['九江银行']
+        }
+      ],
+      bankNameList: []
     }
   },
   // 根据权限显示列表字段
@@ -184,9 +224,10 @@ export default {
         { title: '申请人', dataIndex: 'applyPersonName', align: 'center', width: '5%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '收款事由', dataIndex: 'bookReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款日期', dataIndex: 'receiptDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '付款方类型', dataIndex: 'payerTypeDictValue', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '付款方', dataIndex: 'payerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '财务编码', dataIndex: 'kdMidCustomerFnumber', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '营业执照名称', dataIndex: 'licenseName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '付款账户(营业执照)', dataIndex: 'payerAccountInfo', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '订单金额', dataIndex: 'orderAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '收款金额', dataIndex: 'receiptAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '使用授信', dataIndex: 'useCreditAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
@@ -202,8 +243,20 @@ export default {
     }
   },
   methods: {
-    custChange (val) {
-      this.queryParam.dealerSn = val.key
+    getCount (params) {
+      financeBookReportDetailCount(params).then(res => {
+        this.countData = res.data
+      })
+    },
+    handleChange (v) {
+      if (v) {
+        const row = this.bankList.find(item => item.bankAccount == v)
+        this.bankNameList = row.bankName
+        this.queryParam.bankName = undefined
+      } else {
+        this.queryParam.bankAccount = undefined
+        this.queryParam.bankName = undefined
+      }
     },
     //  创建时间  change
     receiptDateChange (date) {
@@ -233,13 +286,13 @@ export default {
       this.queryParam.dispatchBillNo = ''
       this.queryParam.applyPersonSn = undefined
       this.queryParam.kdMidCustomerFnumber = ''
-      this.queryParam.dealerSn = undefined
-      this.queryParam.licenseName = ''
+      this.queryParam.payerName = undefined
+      this.queryParam.payerAccountInfo = ''
       this.queryParam.fullPaymentFlag = undefined
       this.queryParam.bankName = undefined
+      this.queryParam.bankAccount = undefined
       this.queryParam.subareaSn = undefined
       this.queryParam.provinceSn = undefined
-      this.$refs.settleClientName.resetForm()
       this.$refs.table.refresh(true)
     },
     //  导出
@@ -260,7 +313,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 195
+      this.tableHeight = window.innerHeight - tableSearchH - 205
     }
   },
   watch: {

+ 12 - 7
src/views/financialManagement/financialCollection/detail.vue

@@ -70,6 +70,10 @@
             </div>
             <div style="padding:10px;text-align:center;" v-else>暂无数据</div>
           </template>
+          <!-- 付款账户(营业执照) -->
+          <template slot="payerAccountInfo" slot-scope="record">
+            {{ record.payerAccountInfo || '--' }}
+          </template>
         </s-table>
       </a-card>
     </a-spin>
@@ -113,20 +117,21 @@ export default {
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '收款日期', dataIndex: 'receiptDate', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '财务编码', dataIndex: 'dealerEntity.kdMidCustomerFnumber', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '营业执照名称', dataIndex: 'dealerEntity.licenseName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '收款日期', dataIndex: 'receiptDate', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '付款方类型', dataIndex: 'payerTypeDictValue', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '付款方', dataIndex: 'payerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '财务编码', dataIndex: 'dealerEntity.kdMidCustomerFnumber', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '付款账户(营业执照)', scopedSlots: { customRender: 'payerAccountInfo' }, align: 'center', width: '8%' },
         { title: '订单金额', dataIndex: 'orderAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '收款金额', dataIndex: 'receiptAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '使用授信', dataIndex: 'useTotalAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '授信还款', dataIndex: 'payTotalAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '余款抵扣', dataIndex: 'balanceAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '跨月打款', dataIndex: 'nextMonthAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
-        { title: '户名', dataIndex: 'bankAccount', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
-        { title: '汇入银行', dataIndex: 'bankName', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '户名', dataIndex: 'bankAccount', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '汇入银行', dataIndex: 'bankName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
-        { title: '备注', dataIndex: 'remarks', align: 'center', width: '13%', customRender: function (text) { return text || '--' } }
+        { title: '备注', dataIndex: 'remarks', align: 'center', width: '10%', customRender: function (text) { return text || '--' } }
       ],
       useCol: [
         { title: '使用授信项目', dataIndex: 'itemName', width: '50%', align: 'center' },

+ 13 - 8
src/views/financialManagement/financialCollection/edit.vue

@@ -77,6 +77,10 @@
             </div>
             <div style="padding:10px;text-align:center;" v-else>暂无数据</div>
           </template>
+          <!-- 付款账户(营业执照) -->
+          <template slot="payerAccountInfo" slot-scope="record">
+            {{ record.payerAccountInfo || '--' }}
+          </template>
           <template slot="action" slot-scope="text,record">
             <a-button
               size="small"
@@ -165,21 +169,22 @@ export default {
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '收款日期', dataIndex: 'receiptDate', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '财务编码', dataIndex: 'dealerEntity.kdMidCustomerFnumber', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '营业执照名称', dataIndex: 'dealerEntity.licenseName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '收款日期', dataIndex: 'receiptDate', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '付款方类型', dataIndex: 'payerTypeDictValue', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '付款方', dataIndex: 'payerName', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '财务编码', dataIndex: 'dealerEntity.kdMidCustomerFnumber', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '付款账户(营业执照)', scopedSlots: { customRender: 'payerAccountInfo' }, align: 'center', width: '7%' },
         { title: '订单金额', dataIndex: 'orderAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '收款金额', dataIndex: 'receiptAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '使用授信', dataIndex: 'useTotalAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '授信还款', dataIndex: 'payTotalAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '余款抵扣', dataIndex: 'balanceAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '跨月打款', dataIndex: 'nextMonthAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
-        { title: '户名', dataIndex: 'bankAccount', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
-        { title: '汇入银行', dataIndex: 'bankName', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
+        { title: '户名', dataIndex: 'bankAccount', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
+        { title: '汇入银行', dataIndex: 'bankName', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
         { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
-        { title: '备注', dataIndex: 'remarks', align: 'center', width: '13%', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+        { title: '备注', dataIndex: 'remarks', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       useCol: [
         { title: '使用授信项目', dataIndex: 'itemName', width: '50%', align: 'center' },

+ 143 - 39
src/views/financialManagement/financialCollection/fcDetailModal.vue

@@ -22,24 +22,70 @@
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
-            <a-form-model-item style="margin-bottom:5px;" label="客户名称" prop="dealerSn">
+            <a-form-model-item style="margin-bottom:5px;" label="付款方类型" prop="payerType">
+              <v-select
+                v-model="form.payerType"
+                showType="radio"
+                code="PAYER_TYPE"
+                placeholder="请选择付款方类型"
+                @change="payerTypeChange"
+              ></v-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <!-- 经销售 -->
+        <a-row v-if="form.payerType=='DEALER'" >
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="付款方" prop="dealerSn">
               <dealerSubareaScopeList ref="settleClientName" @change="custChange" />
             </a-form-model-item>
           </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="付款账户类型" prop="payerAccountType">
+              <v-select
+                v-model="form.payerAccountType"
+                showType="radio"
+                code="PAYER_ACCOUNT_TYPE"
+                placeholder="请选择付款账户类型"
+                @change="accountTypeChange"
+              ></v-select>
+            </a-form-model-item>
+          </a-col>
         </a-row>
-        <a-row>
+        <a-row v-if="form.payerType=='DEALER'" >
+          <!-- 公户 -->
+          <a-col :span="12" v-if="form.payerAccountType=='PUBLIC'">
+            <a-form-model-item style="margin-bottom:5px;" label="营业执照名称">
+              <a-input :maxLength="30" placeholder="请输入营业执照名称" v-model="form.payerAccountInfo"></a-input>
+            </a-form-model-item>
+          </a-col>
+          <!-- 私户 -->
+          <a-col :span="12" v-if="form.payerAccountType=='PRIVATE'">
+            <a-form-model-item style="margin-bottom:5px;" label="付款账户">
+              <a-input :maxLength="30" placeholder="付款账户" v-model="form.payerAccountInfo"></a-input>
+            </a-form-model-item>
+          </a-col>
           <a-col :span="12">
             <a-form-model-item style="margin-bottom:5px;" label="财务编码">
               {{ form.dealerCode||'--' }}
-              <!-- <a-input :maxLength="100" placeholder="请输入财务编码" v-model="form.dealerCode"></a-input> -->
             </a-form-model-item>
           </a-col>
+        </a-row>
+        <!-- 部门或其它 -->
+        <a-row v-if="form.payerType=='DEPT'" >
           <a-col :span="12">
-            <a-form-model-item style="margin-bottom:5px;" label="营业执照名称">
-              {{ form.licenseName||'--' }}
-              <!-- <a-input :maxLength="100" placeholder="请输入营业执照名称" v-model="form.licenseName"></a-input> -->
+            <a-form-model-item style="margin-bottom:5px;" label="付款方" prop="payerName">
+              <a-input :maxLength="30" placeholder="请输入付款方名称" v-model="form.payerName"></a-input>
             </a-form-model-item>
           </a-col>
+          <a-col :span="12">
+            <a-form-model-item style="margin-bottom:5px;" label="付款账户">
+              <a-input :maxLength="30" placeholder="付款账户" v-model="form.payerAccountInfo"></a-input>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-divider />
+        <a-row>
           <a-col :span="12">
             <a-form-model-item style="margin-bottom:5px;" label="订单金额">
               <a-input-number
@@ -156,7 +202,7 @@ import { commonMixin } from '@/utils/mixin'
 import { VSelect, Upload } from '@/components'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import fcDetailSxItem from './fcDetailSxItem.vue'
-import { financeBookDetailSave, financeBookDetailQueryBySn } from '@/api/financeBook.js'
+import { financeBookDetailSave, financeBookDetailQueryBySn, lastPayerAccountInfo } from '@/api/financeBook.js'
 export default {
   name: 'FcDetailModal',
   mixins: [commonMixin],
@@ -188,11 +234,14 @@ export default {
         wrapperCol: { span: 16 }
       },
       form: {
+        payerType: 'DEALER',
+        payerAccountType: 'PUBLIC',
         dealerSn: undefined,
-        dealerName: '',
+        payerName: '',
+        payerAccountInfo: '',
+        licenseName: '',
         receiptDate: moment(),
         dealerCode: '',
-        licenseName: '',
         orderAmount: '',
         receiptAmount: '',
         useCreditFlag: false,
@@ -208,7 +257,10 @@ export default {
       },
       rules: {
         receiptDate: [ { required: true, message: '请选择收款日期', trigger: ['change', 'blur'] } ],
-        dealerSn: [ { required: true, message: '请选择客户', trigger: ['change', 'blur'] } ]
+        payerType: [ { required: true, message: '请选择付款方类型', trigger: ['change', 'blur'] } ],
+        dealerSn: [ { required: true, message: '请选择付款方', trigger: ['change', 'blur'] } ],
+        payerName: [ { required: true, message: '请输入付款方名称', trigger: ['change', 'blur'] } ],
+        payerAccountType: [ { required: true, message: '请选择付款账户类型', trigger: ['change', 'blur'] } ]
       },
       useTotalAmount: '',
       payTotalAmount: '',
@@ -234,18 +286,62 @@ export default {
     }
   },
   methods: {
+    payerTypeChange (v) {
+      this.$refs.ruleForm.clearValidate()
+      // 重置数据
+      this.form.dealerSn = ''
+      this.form.dealerCode = ''
+      this.form.licenseName = ''
+      this.form.payerAccountType = 'PUBLIC'
+      this.form.payerAccountInfo = ''
+      this.form.payerName = ''
+    },
+    accountTypeChange (v) {
+      this.$refs.ruleForm.clearValidate()
+      // 已选经销商
+      if (this.form.dealerSn) {
+        // 查询账户信息
+        this.getLastPayerAccount()
+      } else {
+        this.form.licenseName = ''
+        this.form.payerAccountInfo = ''
+      }
+    },
     handleChange (v) {
       console.log(v)
       const row = this.bankList.find(item => item.bankAccount == v)
       this.bankNameList = row.bankName
       this.form.bankName = undefined
     },
+    getLastPayerAccount () {
+      this.spinning = true
+      this.confirmLoading = true
+      lastPayerAccountInfo({
+        payerAccountType: this.form.payerAccountType,
+        dealerSn: this.form.dealerSn
+      }).then(res => {
+        this.spinning = false
+        this.confirmLoading = false
+        this.form.payerAccountInfo = res.data || ''
+      })
+    },
     // 客户
     custChange (v) {
-      this.form.dealerSn = v.key
-      this.form.dealerName = v.name
-      this.form.licenseName = v.row ? v.row.licenseName : ''
-      this.form.dealerCode = v.row ? v.row.kdMidCustomerFnumber : ''
+      console.log(v)
+      if (v && v.key) {
+        this.form.dealerSn = v.key
+        this.form.payerName = v.row ? v.row.dealerName : ''
+        this.form.dealerCode = v.row ? v.row.kdMidCustomerFnumber : ''
+        this.form.licenseName = v.row ? v.row.licenseName : ''
+        // 查询账户信息
+        this.getLastPayerAccount()
+      } else {
+        this.form.dealerSn = ''
+        this.form.payerName = ''
+        this.form.dealerCode = ''
+        this.form.licenseName = ''
+        this.form.payerAccountInfo = ''
+      }
     },
     updateUseAmount (v) {
       this.useTotalAmount = v
@@ -277,9 +373,10 @@ export default {
       form.useCreditFlag = form.useCreditFlag ? 1 : 0
       form.bookSn = this.bookSn
       form.bookNo = this.bookNo
-      delete form.dealerName
-      delete form.licenseName
       delete form.dealerCode
+      if (form.payerType == 'DEPT') {
+        delete form.payerAccountType
+      }
       console.log(form)
       if ((form.useCreditFlag && form.detailItemUseList.length == 0) || this.validItem(form.detailItemUseList)) {
         this.$message.info('使用授信项目不能为空')
@@ -315,8 +412,10 @@ export default {
           this.form.payCreditFlag = this.form.payCreditFlag == 1
           this.form.useCreditFlag = this.form.useCreditFlag == 1
           // 回显客户
-          if (this.form.dealerSn) {
-            this.$refs.settleClientName.getDetail(this.form.dealerSn)
+          if (this.form.dealerSn && this.form.payerType == 'DEALER') {
+            this.$nextTick(() => {
+              this.$refs.settleClientName.getDetail(this.form.dealerSn)
+            })
           }
         }
         this.spinning = false
@@ -331,29 +430,34 @@ export default {
     pageInit () {
       this.$nextTick(() => {
         this.title = '新增收款明细'
-        this.$refs.ruleForm.resetFields()
-        this.$refs.settleClientName.resetForm()
-        this.bankNameList = []
-        this.form = {
-          dealerSn: undefined,
-          dealerName: '',
-          receiptDate: moment(),
-          dealerCode: '',
-          licenseName: '',
-          orderAmount: '',
-          receiptAmount: '',
-          useCreditFlag: false,
-          detailItemUseList: [],
-          payCreditFlag: false,
-          detailItemPayList: [],
-          balanceAmount: '',
-          nextMonthAmount: '',
-          bankAccount: undefined,
-          bankName: undefined,
-          fullPaymentFlag: undefined,
-          remarks: ''
+        if (this.$refs.settleClientName) {
+          this.$refs.settleClientName.resetForm()
         }
       })
+      this.bankNameList = []
+      this.form = {
+        payerType: 'DEALER',
+        payerAccountType: 'PUBLIC',
+        dealerSn: undefined,
+        payerName: '',
+        payerAccountInfo: '',
+        licenseName: '',
+        receiptDate: moment(),
+        dealerCode: '',
+        orderAmount: '',
+        receiptAmount: '',
+        useCreditFlag: false,
+        detailItemUseList: [],
+        payCreditFlag: false,
+        detailItemPayList: [],
+        balanceAmount: '',
+        nextMonthAmount: '',
+        bankAccount: undefined,
+        bankName: undefined,
+        fullPaymentFlag: undefined,
+        remarks: ''
+      }
+      this.$refs.ruleForm.resetFields()
     }
   },
   watch: {

+ 1 - 1
src/views/financialManagement/financialCollection/fcDetailSxItem.vue

@@ -58,7 +58,7 @@ export default {
     getTotal () {
       let ret = 0
       this.detailItemList.map(item => {
-        ret = ret + item.itemAmount
+        ret = ret + (item.itemAmount || 0)
         delete item.id
       })
       this.$emit('updateItemAmount', ret.toFixed(2))

+ 40 - 15
src/views/financialManagement/financialCollection/list.vue

@@ -21,22 +21,27 @@
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="申请人">
                   <employee style="width: 100%;" id="financialCollectionList-Employee" placeholder="请选择申请人" v-model="queryParam.applyPersonSn"></employee>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="收款事由">
                   <a-input id="financialCollectionList-bookReason" v-model.trim="queryParam.bookReason" allowClear placeholder="请输入收款事由"/>
                 </a-form-item>
               </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="付款方">
+                  <a-input id="financialCollectionList-payerNames" v-model.trim="queryParam.payerName" allowClear placeholder="请输入付款方"/>
+                </a-form-item>
+              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="审核时间">
                   <rangeDate ref="rangeAuditDate" :value="auditDate" @change="dateAuditChange" />
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
                 <a-form-item label="状态">
                   <v-select
                     v-model="queryParam.status"
@@ -58,10 +63,19 @@
             </a-col>
           </a-row>
         </a-form>
-      </div>
-      <!-- 操作按钮 -->
-      <div class="table-operator" v-if="$hasPermissions('B_fc_new')">
-        <a-button type="primary" class="button-error" @click="handleAdd">新增</a-button>
+        <!-- 操作按钮 -->
+        <div class="table-operator" v-if="$hasPermissions('B_fc_new')">
+          <a-button type="primary" class="button-error" @click="handleAdd">新增</a-button>
+        </div>
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            订单总金额:{{ countData&&countData.orderTotalAmount||0 }}元;
+            收款总金额:{{ countData&&countData.receiptTotalAmount||0 }}元;
+            使用授信总金额:{{ countData&&countData.useTotalAmount||0 }}元;
+            授信还款总金额:{{ countData&&countData.payTotalAmount||0 }}元;
+            余款抵扣总金额:{{ countData&&countData.balanceTotalAmount||0 }}元;
+          </div>
+        </a-alert>
       </div>
       <!-- 列表 -->
       <s-table
@@ -143,7 +157,7 @@ import baseModal from './baseModal.vue'
 import employee from '../../expenseManagement/expenseReimbursement/employee.js'
 import verifyModal from './verifyModal.vue'
 import dispatchModal from './dispatchModal.vue'
-import { financeBookQueryPage, financeBookDeleteBySn, financeBookDgainEditBySn } from '@/api/financeBook.js'
+import { financeBookQueryPage, financeBookDeleteBySn, financeBookDgainEditBySn, financeBookQueryCount } from '@/api/financeBook.js'
 export default {
   name: 'FinancialCollectionList',
   mixins: [commonMixin],
@@ -164,7 +178,8 @@ export default {
         auditEndDate: '',
         applyPersonSn: undefined,
         bookReason: '',
-        status: undefined
+        status: undefined,
+        payerName: ''
       },
       disabled: false, //  查询、重置按钮是否可操作
       creatDate: [], //  创建时间
@@ -175,7 +190,8 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return financeBookQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
+        const params = Object.assign(parameter, this.queryParam)
+        return financeBookQueryPage(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -187,10 +203,12 @@ export default {
             this.disabled = false
           }
           this.spinning = false
+          this.getCount(params)
           return data
         })
       },
-      total: 0 // 合计
+      total: 0, // 合计
+      countData: null
     }
   },
   // 根据权限显示列表字段
@@ -201,8 +219,9 @@ export default {
         { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款单号', scopedSlots: { customRender: 'bookNo' }, width: '8%', align: 'center' },
         { title: '关联备货单', scopedSlots: { customRender: 'dispatchNum' }, width: '6%', align: 'center' },
-        { title: '申请人', dataIndex: 'applyPersonName', align: 'center', width: '6%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '收款事由', dataIndex: 'bookReason', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请人', dataIndex: 'applyPersonName', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
+        { title: '收款事由', dataIndex: 'bookReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '付款方', dataIndex: 'payerNames', width: '9%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '订单总金额', dataIndex: 'orderTotalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '收款总金额', dataIndex: 'receiptTotalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '使用授信总金额', dataIndex: 'useTotalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -210,12 +229,17 @@ export default {
         { title: '余款抵扣总金额', dataIndex: 'balanceTotalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '状态', dataIndex: 'statusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       return arr
     }
   },
   methods: {
+    getCount (params) {
+      financeBookQueryCount(params).then(res => {
+        this.countData = res.data
+      })
+    },
     //  创建时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0] ? date[0] : ''
@@ -236,6 +260,7 @@ export default {
       if (this.advanced) {
         this.$refs.rangeAuditDate.resetDate(this.auditDate)
       }
+      this.queryParam.payerName = ''
       this.queryParam.auditBeginDate = ''
       this.queryParam.auditEndDate = ''
       this.queryParam.bookNo = ''
@@ -320,7 +345,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 235
+      this.tableHeight = window.innerHeight - tableSearchH - 210
     }
   },
   watch: {

+ 5 - 4
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -204,13 +204,14 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '21%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号', dataIndex: 'stackPlaceEntity.stackPlaceCode', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '最后入库时间', dataIndex: 'lastStockTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productUnit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productBrandName', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '可用库存数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '16%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
         arr.splice(7, 0, { title: '可用库存成本', dataIndex: 'currentStockCost', width: '10%', align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } })

+ 14 - 25
src/views/inventoryManagement/makeInventory/check.vue

@@ -15,6 +15,7 @@
             class="button-info"
             id="makeInventoryCheck-print-btn"
             :disabled="list.length==0"
+            :loading="spinningPrint"
             v-if="$hasPermissions('B_inventoryMakeInventoryPrint')"
             @click="handlePdPrint">盘点打印</a-button>
         </template></a-page-header>
@@ -140,16 +141,8 @@
         style="padding: 0 60px;">提交盘点</a-button>
     </div>
     <!-- 盘点打印确认 -->
-    <printModal
-      :openModal="visiblePrint"
-      :content="printContent"
-      :okText="printOkText"
-      cancelText="打印预览"
-      :isCancel="isPrintCancel"
-      :spinning="spinningPrint"
-      @close="visiblePrint=false"
-      @ok="printOkText == '好的' ? visiblePrint=false : handlePrint('print')"
-      @fail="handlePrint('preview')" />
+    <print-modal :openModal="visiblePrint" nowType="CHECK_WAREHOUSE" :itemData="detail" @ok="handlePrint" @close="visiblePrint=false" />
+    <div id="print"></div>
   </div>
 </template>
 
@@ -157,8 +150,8 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import tablePagination from '@/views/common/tablePagination.vue'
-import printModal from '@/views/common/auditModal.vue'
-import { printFun, exportExcel } from '@/libs/JGPrint.js'
+import printModal from './printModal.vue'
+import { printFun } from '@/libs/JGPrint.js'
 import { checkWarehouseDetail, checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseDetailPrint, checkWarehousePrintCheck, checkWarehouseDetailSave, checkWarehouseCheck } from '@/api/checkWarehouse'
 export default {
   name: 'MakeInventoryCheck',
@@ -197,10 +190,7 @@ export default {
       foldState: false, //  是否折叠列表
       productTotal: null, //  合计
       spinningPrint: false,
-      visiblePrint: false,
-      printContent: '',
-      printOkText: '',
-      isPrintCancel: false
+      visiblePrint: false
     }
   },
   methods: {
@@ -364,24 +354,23 @@ export default {
         this.spinning = false
         if (res.status == 200) {
           if (res.data && res.data == 0) { // 无产品
-            this.printContent = '此盘点单没有产品,无法打印'
-            this.printOkText = '好的'
-            this.isPrintCancel = false
-            this.visiblePrint = true
+            this.$info({
+              title: '提示',
+              content: '此盘点单没有产品,无法打印',
+              centered: true
+            })
           } else { // 有产品
-            this.printContent = '打印范围 —— 所有盘点产品(批次合并)'
-            this.printOkText = '立即打印'
-            this.isPrintCancel = true
+            this.detail.printContent = '打印范围 —— 所有盘点产品(批次合并)'
             this.visiblePrint = true
           }
         }
       })
     },
     // 打印预览/快捷打印
-    handlePrint (type) {
+    handlePrint (objs, type) {
       const _this = this
       _this.spinningPrint = true
-      const params = { checkWarehouseSn: this.$route.params.sn, type: 'CHECK_WAREHOUSE' }
+      const params = { checkWarehouseSn: this.$route.params.sn, superviseFlag: false, ...objs }
       printFun(checkWarehouseDetailPrint, params, type, '盘点单', () => { _this.spinningPrint = false })
     }
   },

+ 129 - 0
src/views/inventoryManagement/makeInventory/printModal.vue

@@ -0,0 +1,129 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    class="sales-print-type-modal"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="sales-print-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="盘点单号">{{ itemData&&itemData.checkWarehouseNo || '--' }}</a-form-model-item>
+        <a-form-model-item label="打印范围">{{ itemData&&itemData.printContent || '--' }}</a-form-model-item>
+        <a-form-model-item label="货位编号" prop="orderBy">
+          <a-radio-group v-model="form.orderBy">
+            <a-radio value="ASC">打印(↑升序)</a-radio>
+            <a-radio value="DESC">打印(↓降序)</a-radio>
+            <a-radio value="-1">不打印</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button id="sales-print-back" @click="handleCancel">取消</a-button>
+        <a-button type="primary" class="button-info" id="sales-print-orginPreview" @click="handleSave('orginPreview')" style="margin-left: 15px;">打印预览</a-button>
+        <a-button type="primary" id="sales-print-save" @click="handleSave('orginPrint')" style="margin-left: 10px;">立即打印</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+export default {
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemData: {
+      type: Object,
+      default: () => {
+        return null
+      }
+    },
+    nowType: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      form: {
+        orderBy: undefined
+      },
+      rules: {
+        orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }]
+      },
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
+      },
+      spinning: false,
+      typeList: []
+    }
+  },
+  computed: {
+    modalTit () {
+      return this.nowType == 'CHECK_WAREHOUSE' ? '盘点打印' : '监盘打印'
+    }
+  },
+  methods: {
+    // 确认
+    handleSave (type) {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const obj = {
+            printType: _this.nowType
+          }
+          // 打印货位编号
+          if (_this.form.orderBy != '-1') {
+            obj.orderBy = _this.form.orderBy
+            obj.printType = obj.printType + '_STACK_PLACE'
+          }
+          _this.$emit('ok', obj, type)
+          _this.isShow = false
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 取消选择分类
+    handleCancel () {
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .sales-print-type-modal{
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 14 - 25
src/views/inventoryManagement/supervisionDisk/check.vue

@@ -15,6 +15,7 @@
             class="button-info"
             id="supervisionDiskCheck-print-btn"
             :disabled="list.length==0"
+            :loading="spinningPrint"
             v-if="$hasPermissions('B_supervisionDiskPrint')"
             @click="handlePdPrint">监盘打印</a-button>
         </template></a-page-header>
@@ -149,16 +150,8 @@
         style="padding: 0 60px;margin-left: 15px">提交监盘</a-button>
     </div>
     <!-- 盘点打印确认 -->
-    <printModal
-      :openModal="visiblePrint"
-      :content="printContent"
-      :okText="printOkText"
-      cancelText="打印预览"
-      :isCancel="isPrintCancel"
-      :spinning="spinningPrint"
-      @close="visiblePrint=false"
-      @ok="printOkText == '好的' ? visiblePrint=false : handlePrint('print')"
-      @fail="handlePrint('preview')" />
+    <print-modal :openModal="visiblePrint" nowType="CHECK_WAREHOUSE_SUPERVISE" :itemData="detail" @ok="handlePrint" @close="visiblePrint=false" />
+    <div id="print"></div>
   </div>
 </template>
 
@@ -166,8 +159,8 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import tablePagination from '@/views/common/tablePagination.vue'
-import printModal from '@/views/common/auditModal.vue'
-import { printFun, exportExcel } from '@/libs/JGPrint.js'
+import printModal from '../makeInventory/printModal.vue'
+import { printFun } from '@/libs/JGPrint.js'
 import { checkWarehouseDetail, checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseDetailPrint, checkWarehousePrintCheck, checkWarehouseDetailSave, checkWarehouseSupervise, checkWarehouseReCheck } from '@/api/checkWarehouse'
 export default {
   name: 'SupervisionDiskCheck',
@@ -207,10 +200,7 @@ export default {
       foldState: false, //  是否折叠列表
       productTotal: null, //  合计
       spinningPrint: false,
-      visiblePrint: false,
-      printContent: '',
-      printOkText: '',
-      isPrintCancel: false
+      visiblePrint: false
     }
   },
   methods: {
@@ -396,24 +386,23 @@ export default {
         this.spinning = false
         if (res.status == 200) {
           if (res.data && res.data == 0) { // 无产品
-            this.printContent = '打印模板内容是所有有盈亏的产品,此单盘点人盘点无盈亏记录,无法打印'
-            this.printOkText = '好的'
-            this.isPrintCancel = false
-            this.visiblePrint = true
+            this.$info({
+              title: '提示',
+              content: '打印模板内容是所有有盈亏的产品,此单盘点人盘点无盈亏记录,无法打印',
+              centered: true
+            })
           } else { // 有产品
-            this.printContent = '打印范围 —— 有盈亏(批次合并)'
-            this.printOkText = '立即打印'
-            this.isPrintCancel = true
+            this.detail.printContent = '打印范围 —— 有盈亏(批次合并)'
             this.visiblePrint = true
           }
         }
       })
     },
     // 打印预览/快捷打印
-    handlePrint (type) {
+    handlePrint (objs, type) {
       const _this = this
       _this.spinningPrint = true
-      const params = { checkWarehouseSn: this.$route.params.sn, type: 'CHECK_WAREHOUSE_SUPERVISE' }
+      const params = { checkWarehouseSn: this.$route.params.sn, superviseFlag: true, ...objs }
       printFun(checkWarehouseDetailPrint, params, type, '盘点单', () => { _this.spinningPrint = false })
     }
   },

+ 104 - 0
src/views/productManagement/shelfNoManage/changeRecordModal.vue

@@ -0,0 +1,104 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    title="变更记录"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="50%">
+    <a-descriptions size="small" :column="1">
+      <a-descriptions-item label="产品编码">
+        {{ detailData&&detailData.productVO.code || '--' }}
+      </a-descriptions-item>
+      <a-descriptions-item label="产品名称">
+        {{ detailData&&detailData.productVO.name || '--' }}
+      </a-descriptions-item>
+    </a-descriptions>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 500 }"
+        :showPagination="false"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { stackPlaceListHistory } from '@/api/product'
+export default {
+  name: 'ChangeRecordModal',
+  components: { STable },
+  props: {
+    openModal: {
+      type: Boolean,
+      default: false
+    },
+    detailData: {
+      type: Object,
+      default: function () {
+        return null
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '变更时间', dataIndex: 'updateDate', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '变更人', dataIndex: 'creatorName', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号-变更前', dataIndex: 'oldStackPlaceCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号-变更后', dataIndex: 'newStackPlaceCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        delete parameter.tableId
+        delete parameter.index
+        return stackPlaceListHistory({ productSn: this.detailData.productVO.productSn }).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  watch: {
+    openModal (nVal, oVal) {
+      this.isShow = nVal
+    },
+    isShow (nVal, oVal) {
+      if (!nVal) {
+        this.$emit('close')
+        this.$refs.table.clearTable()
+      } else {
+        this.$nextTick(() => {
+          this.$refs.table.refresh()
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 189 - 0
src/views/productManagement/shelfNoManage/chooseImportModal.vue

@@ -0,0 +1,189 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="900">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { hdExportExcel } from '@/libs/exportExcel'
+import { stackPlaceImport, stackPlaceExportError } from '@/api/product'
+export default {
+  name: 'ChooseImportModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '产品编码', dataIndex: 'code', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号-变更前', dataIndex: 'oldStackPlaceCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号-变更后', dataIndex: 'newStackPlaceCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      loadData: [],
+      nowUnColumns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
+        { title: '产品编码', dataIndex: 'code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号-变更前', dataIndex: 'oldStackPlaceCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号-变更后', dataIndex: 'newStackPlaceCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'errorMsg', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    getData () {
+      const _this = this
+      this.loading = true
+      const params = {
+        path: this.paramsData.path
+      }
+      stackPlaceImport(params).then(res => {
+        this.loading = false
+        if (res.status == 200) {
+          if (res.data.rightList && res.data.rightList.length > 0) {
+            res.data.rightList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          if (res.data.errorList && res.data.errorList.length > 0) {
+            res.data.errorList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          _this.loadData = res.data.rightList || []
+          _this.unLoadData = res.data.errorList || []
+        }
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入货位编号!')
+      } else {
+        this.$emit('ok', this.loadData)
+        this.isShow = false
+      }
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出的错误项~')
+        return
+      }
+      _this.spinning = true
+      hdExportExcel(stackPlaceExportError, _this.unLoadData, '货位编号导入错误项', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 148 - 0
src/views/productManagement/shelfNoManage/editHwModal.vue

@@ -0,0 +1,148 @@
+<template>
+  <a-modal
+    centered
+    class="shelfSet-newHw-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="编辑"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="shelfSet-newHw-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="产品编码">{{ nowData&&nowData.productVO.code || '--' }}</a-form-model-item>
+        <a-form-model-item label="产品名称">{{ nowData&&nowData.productVO.name || '--' }}</a-form-model-item>
+        <a-form-model-item label="货位编号" prop="stackPlaceCode">
+          <a-input v-model="form.stackPlaceCode" :maxLength="10" placeholder="请输入货位编号(最多10个字符)"></a-input>
+          <div style="color:#fba200;font-size:12px;">货位编号允许为空,为空则表示此产品没有货位编号</div>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" id="shelfSet-newHw-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="shelfSet-newHw-modal-back" @click="isShow=false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { stackPlaceSave } from '@/api/product'
+export default {
+  name: 'EditHwModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    type: {
+      type: String,
+      default: 'edit'
+    },
+    nowData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        shelfPlaceCode: '',
+        productSn: undefined,
+        productCode: undefined,
+        price: '',
+        cost: '',
+        maxQty: ''
+      },
+      rules: {
+        shelfPlaceCode: [
+          { required: true, message: '请输入货位编号', trigger: 'blur' }
+        ]
+      },
+      productName: ''
+    }
+  },
+  methods: {
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          const params = {
+            'stackPlaceCode': form.stackPlaceCode.toUpperCase(),
+            'product': {
+              'productSn': _this.nowData.productVO.productSn
+            }
+          }
+          // 开始提交数据
+          _this.spinning = true
+          stackPlaceSave(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.isShow = false
+              _this.$emit('ok', res.data)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    resetData () {
+      this.form.stackPlaceCode = undefined
+      this.$refs.ruleForm.resetFields()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetData()
+      } else {
+        if (this.type == 'edit') {
+          this.form.stackPlaceCode = this.nowData.stackPlaceCode
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.shelfSet-newHw-modal {
+	.ant-modal-body {
+		padding: 40px 40px 24px;
+	}
+  .ant-form-item{
+    margin-bottom: 15px;
+  }
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 195 - 0
src/views/productManagement/shelfNoManage/importGuideModal.vue

@@ -0,0 +1,195 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="750">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”的列,且名称必须相同</li>
+            <li>2) “产品编码”必须是列表中已存在的产品</li>
+            <li>3) “货位编号”可为空,为空表示此产品没有货位信息</li>
+          </ul>
+          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" @click="handleExport">下载导入模板</a-button>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="import"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="添加文件"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { stackPlaceImportTemplate } from '@/api/product'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      }
+    }
+  },
+  methods: {
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file) {
+        this.paramsData = {
+          path: file
+        }
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    },
+    //  位编号管理导入模板
+    handleExport () {
+      const _this = this
+      this.spinning = true
+      hdExportExcel(stackPlaceImportTemplate, {}, '货位编号管理导入模板', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 312 - 0
src/views/productManagement/shelfNoManage/list.vue

@@ -0,0 +1,312 @@
+<template>
+  <a-card size="small" :bordered="false" class="shelfNoMan-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="4" :sm="24">
+              <a-form-item label="产品编码">
+                <a-input id="shelfNoMan-code" v-model.trim="queryParam.product.code" allowClear placeholder="请输入产品编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="shelfNoMan-name" v-model.trim="queryParam.product.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="原厂编码">
+                <a-input id="shelfNoMan-origCode" v-model.trim="queryParam.product.origCode" allowClear placeholder="请输入原厂编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="产品品牌">
+                <ProductBrand id="shelfNoMan-productBrandSn" v-model="queryParam.product.productBrandSn"></ProductBrand>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="4" :sm="24">
+                <a-form-item label="产品分类">
+                  <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="shelfNoMan-productType"></productTypeAll>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="产品状态">
+                  <v-select code="PRODUCT_STATUS" id="shelfNoMan-state" v-model="queryParam.product.state" allowClear placeholder="请选择产品状态"></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="货位编号">
+                  <a-input id="shelfNoMan-stackPlaceCode" v-model.trim="queryParam.stackPlaceCode" allowClear placeholder="请输入货位编号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="是否有货位编号">
+                  <a-select id="shelfNoMan-haveStackCode" v-model="queryParam.haveStackCode" allowClear placeholder="请选择">
+                    <a-select-option value="1">
+                      有编号
+                    </a-select-option>
+                    <a-select-option value="0">
+                      无编号
+                    </a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shelfNoMan-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="shelfNoMan-reset">重置</a-button>
+              <a-button
+                v-if="$hasPermissions('B_shelfNoManage_export')"
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="shelfNoMan-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button
+          id="shelfNoMan-batchAudit"
+          v-if="$hasPermissions('B_shelfNoManage_import')"
+          type="primary"
+          @click="openGuideModal = true"
+        >批量导入</a-button>
+      </div>
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.productVO.productTypeName2 || record.productVO.productTypeName3">{{ record.productVO.productTypeName2 }} {{ record.productVO.productTypeName3 ? '>' : '' }} {{ record.productVO.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <div>
+            <a-button
+              size="small"
+              type="link"
+              v-if="$hasPermissions('B_shelfNoManage_edit')"
+              class="button-info"
+              @click="handleEdit(record)"
+              id="shelfNoMan-edit-btn">编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              v-if="$hasPermissions('B_shelfNoManage_detail')"
+              class="button-success"
+              @click="handleDetail(record)"
+              id="shelfNoMan-detail-btn">变更记录</a-button>
+          </div>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 导入产品 -->
+    <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="hanldeOk" />
+    <!-- 编辑 -->
+    <editHwModal :openModal="openModal" :nowData="nowData" @ok="editOk" @close="closeModal" />
+    <!-- 变更记录 -->
+    <changeRecordModal :openModal="recordModal" :detailData="nowData" @close="closeModal"></changeRecordModal>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import editHwModal from './editHwModal.vue'
+import ProductBrand from '@/views/common/productBrand.js'
+import productTypeAll from '@/views/common/productTypeAll.js'
+import { exportExcel } from '@/libs/JGPrint.js'
+import ImportGuideModal from './importGuideModal.vue'
+import changeRecordModal from './changeRecordModal.vue'
+import { queryStackPlaceQueryPage, stackPlaceExport, stackPlaceInsertImport } from '@/api/product'
+export default {
+  name: 'ProductInfoList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, editHwModal, ProductBrand, productTypeAll, ImportGuideModal, changeRecordModal },
+  data () {
+    return {
+      spinning: false,
+      openGuideModal: false,
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        stackPlaceCode: undefined, // 货位编号
+        haveStackCode: undefined,
+        product: {
+          name: '', //  产品名称
+          code: '', // 产品编码
+          origCode: '', // 原厂编码
+          productBrandSn: undefined, //  产品品牌
+          productTypeSn1: '', //  产品一级分类
+          productTypeSn2: '', //  产品二级分类
+          productTypeSn3: '', //  产品三级分类
+          state: undefined //  产品状态
+        }
+      },
+      productType: [],
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productVO.code', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productVO.name', align: 'center', width: '30%', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productVO.origCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productVO.productBrandName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '10%', align: 'center' },
+        { title: '产品状态', dataIndex: 'productVO.stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '货位编号', dataIndex: 'stackPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
+      ],
+      loadingAudit: false,
+      loadingLaunch: false,
+      loadingDownline: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return queryStackPlaceQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      openModal: false, //  编辑弹框
+      recordModal: false, // 变更记录弹框
+      nowData: null, //  当前sn
+      pageFromInfo: null
+    }
+  },
+  methods: {
+    // 导入产品
+    hanldeOk (obj) {
+      stackPlaceInsertImport(obj).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm()
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam = {
+        stackPlaceCode: undefined, // 货位编号
+        haveStackCode: undefined,
+        product: {
+          name: '', //  产品名称
+          code: '', // 产品编码
+          origCode: '', // 原厂编码
+          productBrandSn: undefined, //  产品品牌
+          productTypeSn1: '', //  产品一级分类
+          productTypeSn2: '', //  产品二级分类
+          productTypeSn3: '', //  产品三级分类
+          state: undefined //  产品状态
+        }
+      }
+      this.productType = []
+      this.$refs.table.refresh(true)
+    },
+    // 编辑
+    handleEdit (row) {
+      this.nowData = row
+      this.openModal = true
+    },
+    // 编辑成功
+    editOk () {
+      this.closeModal()
+      this.$refs.table.refresh()
+    },
+    //  关闭编辑弹框
+    closeModal () {
+      this.nowData = null
+      this.openModal = false
+      this.recordModal = false
+    },
+    // 变更记录
+    handleDetail (row) {
+      this.nowData = row
+      this.recordModal = true
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      this.spinning = true
+      exportExcel(stackPlaceExport, params, '货位编号导出', function () {
+        _this.spinning = false
+      })
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.product.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.product.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.product.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 235
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.pageFromInfo = from
+    })
+  }
+}
+</script>

+ 26 - 9
src/views/reportData/allocationDetails/list.vue

@@ -41,10 +41,8 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="调拨类型名称">
-                  <a-select id="allocationDetailsList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择调拨类型名称" allowClear >
-                    <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                  </a-select>
+                <a-form-model-item label="费用/调拨类型">
+                  <AllocateType id="allocationDetailsList-allocateTypeSn" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -134,7 +132,7 @@
         :columns="columns"
         :data="loadData"
         :defaultLoadData="false"
-        :scroll="{ x: 2090 }"
+        :scroll="{ x: 2610 }"
         bordered>
         <template slot="footer">
           <a-row :gutter="15">
@@ -165,11 +163,12 @@ import { allocateTypeAllList } from '@/api/allocateType'
 import ProductBrand from '@/views/common/productBrand.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import { userQueryList } from '@/api/power-user'
+import AllocateType from '@/views/common/allocateType.js'
 import { allocateReportDetailList, allocateReportDetailCount, allocateReportDetailExport } from '@/api/allocateReport'
 export default {
   name: 'AllocationDetailsList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, ProductBrand, reportModal },
+  components: { STable, VSelect, rangeDate, subarea, ProductBrand, reportModal, AllocateType },
   data () {
     return {
       spinning: false,
@@ -177,6 +176,7 @@ export default {
       exportLoading: false,
       tableHeight: 0,
       showExport: false,
+      allocateTypeVal: [],
       queryParam: { //  查询条件
         time: [
           getDate.getCurrMonthDays().starttime,
@@ -188,7 +188,9 @@ export default {
         productBrandTypeSn: undefined,
         productBrandSn: undefined, //  产品品牌
         productCode: '',
-        allocateTypeSn: undefined, //  调拨类型
+        costTypeSn: undefined, // 费用类型
+        allocateSortSn: undefined, //  调拨类型1
+        allocateTypeSn: undefined, //  调拨类型2
         creatorId: undefined,
         allocateNo: '',
         productTypeSn1: '', //  产品一级分类
@@ -259,7 +261,7 @@ export default {
         { title: '调拨单号', dataIndex: 'allocateNo', width: 160, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         { title: '调拨开单日期', dataIndex: 'allocateDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省份', dataIndex: 'dealerProvinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'targetName', width: 120,align: 'center', sorter: true, customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'targetName', width: 120, align: 'center', sorter: true, customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
@@ -274,7 +276,13 @@ export default {
         { title: '仓库', dataIndex: 'warehouseName', width: 90, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 90, align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
         { title: '操作员', dataIndex: 'creatorName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '调拨类型', dataIndex: 'allocateTypeName', width: 80, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '费用类型', dataIndex: 'costTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类型(一级)', dataIndex: 'allocateSortName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类型(二级)', dataIndex: 'allocateTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用归属品牌', dataIndex: 'costProductBrandName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用归属品类(二级)', dataIndex: 'costProductTypeName2', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用归属品类(三级)', dataIndex: 'costProductTypeName3', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '费用归属部门', dataIndex: 'departmentName', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
         arr.splice(12, 0, { title: '成本价', dataIndex: 'cost', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
@@ -303,6 +311,12 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    changeAllocatype (val, opts) {
+      this.allocateTypeVal = val || []
+      this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
+      this.queryParam.allocateSortSn = val && val[1] ? val[1] : ''
+      this.queryParam.allocateTypeSn = val && val[2] ? val[2] : ''
+    },
     // 合计
     getCount (params) {
       allocateReportDetailCount(params).then(res => {
@@ -338,6 +352,8 @@ export default {
       this.queryParam.productBrandTypeSn = undefined
       this.queryParam.productBrandSn = undefined
       this.queryParam.productCode = ''
+      this.queryParam.costTypeSn = undefined
+      this.queryParam.allocateSortSn = undefined
       this.queryParam.allocateTypeSn = undefined
       this.queryParam.creatorId = undefined
       this.queryParam.allocateNo = ''
@@ -349,6 +365,7 @@ export default {
       this.queryParam.subareaSn = undefined
       this.queryParam.dealerProvinceSn = undefined
       this.productType = []
+      this.allocateTypeVal = []
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()

+ 16 - 12
src/views/reportData/allocationOrderTotal/list.vue

@@ -40,15 +40,8 @@
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="调拨类别">
-                  <v-select code="ALLOCATE_CATEGORY" id="allocationOrderTotalList-allocateCategory" v-model="queryParam.allocateCategory" allowClear placeholder="请选择调拨类别"></v-select>
-                </a-form-model-item>
-              </a-col>
-              <a-col :md="6" :sm="24">
-                <a-form-model-item label="调拨类型名称">
-                  <a-select id="allocationOrderTotalList-allocateTypeSn" v-model="queryParam.allocateTypeSn" placeholder="请选择调拨类型名称" allowClear >
-                    <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-                  </a-select>
+                <a-form-model-item label="费用/调拨类型">
+                  <AllocateType id="allocationDetailsList-allocateTypeSn" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -98,15 +91,17 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import { allocateTypeAllList } from '@/api/allocateType'
 import { userQueryList } from '@/api/power-user'
+import AllocateType from '@/views/common/allocateType.js'
 import { allocateReportList, allocateReportCount } from '@/api/allocateReport'
 export default {
   name: 'AllocationOrderTotalList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, AllocateType },
   data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
+      allocateTypeVal: [],
       queryParam: { //  查询条件
         time: [
           getDate.getCurrMonthDays().starttime,
@@ -116,8 +111,9 @@ export default {
         endDate: getDate.getCurrMonthDays().endtime,
         allocateNo: '',
         creatorId: undefined,
-        allocateCategory: undefined,
-        allocateTypeSn: undefined
+        costTypeSn: undefined, // 费用类型
+        allocateCategory: undefined, //  调拨类型1
+        allocateTypeSn: undefined //  调拨类型2
       },
       labelCol: { span: 8 },
       wrapperCol: { span: 16 },
@@ -171,6 +167,12 @@ export default {
     }
   },
   methods: {
+    changeAllocatype (val, opts) {
+      this.allocateTypeVal = val || []
+      this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
+      this.queryParam.allocateCategory = val && val[1] ? val[1] : ''
+      this.queryParam.allocateTypeSn = val && val[2] ? val[2] : ''
+    },
     // 盘点库存日期
     handleStock () {
       this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
@@ -218,8 +220,10 @@ export default {
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.allocateNo = ''
       this.queryParam.creatorId = undefined
+      this.queryParam.costTypeSn = undefined
       this.queryParam.allocateCategory = undefined
       this.queryParam.allocateTypeSn = undefined
+      this.allocateTypeVal = []
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       this.$refs.table.clearTable()

+ 327 - 0
src/views/reportData/expenseAccountReport/bearerList.vue

@@ -0,0 +1,327 @@
+<template>
+  <a-card>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="returnGoodsPresentationList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="统计月份" prop="months">
+                <a-input :value="queryParam.months?queryParam.months.join(','):''" placeholder="请选择月份(多选)" style="width: 100%;">
+                  <span style="cursor: pointer;" slot="addonAfter" @click="openMonth">
+                    点击选择
+                  </span>
+                </a-input>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="费用承担方类型" prop="targetType">
+                <v-select
+                  code="EXPENSE_ACCOUNT_DETAIL_SPLIT_OBJ_TYPE"
+                  allowClear
+                  style="width: 100%;"
+                  v-model="queryParam.targetType"
+                  @change="targetChange"
+                  placeholder="请选择费用承担方类型"
+                ></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="费用承担方名称" prop="targetSn">
+                <!-- 部门 -->
+                <department v-show="queryParam.targetType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择费用承担方名称" v-model="queryParam.targetSn"></department>
+                <!-- 经销商 -->
+                <custList
+                  v-show="queryParam.targetType=='CUSTOMER'"
+                  ref="custList"
+                  cooperateFlag="1"
+                  @change="custChange"
+                  placeholder="请选择经销商(输入名称搜索)"></custList>
+                <a-select v-if="!queryParam.targetType" placeholder="请选择费用承担方名称"></a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="returnGoodsPresentationList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="returnGoodsPresentationList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                v-if="$hasPermissions('B_expenseCollectExportByTarget')"
+                :loading="exportLoading"
+                id="returnGoodsPresentationList-export">导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :defaultLoadData="false"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :showPagination="false"
+        :data="loadData"
+        bordered>
+        <template slot="footer">
+          <table v-if="totalData">
+            <tr>
+              <th colspan="5" width="42%" style="text-align: right;">汇总:</th>
+              <th v-for="item in totalMData" width="6%" style="text-align: center;">{{ item }}</th>
+              <th width="6%" style="text-align: center;">{{ totalData['COUNT_PRICE'] }}</th>
+            </tr>
+          </table>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 导出提示框 -->
+    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+    <selectMonth ref="months" @ok="getDateValue"></selectMonth>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import selectMonth from './selectMonth.vue'
+import { hdExportExcel } from '@/libs/exportExcel'
+import reportModal from '@/views/common/reportModal.vue'
+import department from '@/views/expenseManagement/expenseReimbursement/department.js'
+import custList from '@/views/common/custList.vue'
+import { expenseCollectReportQueryPageByTarget, expenseCollectReportQueryCountByTarget, expenseCollectReportExportByTarget } from '@/api/reportData'
+export default {
+  name: 'AllCountryCostReportList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, selectMonth, department, custList, reportModal },
+  data () {
+    return {
+      spinning: false,
+      open: false,
+      year: '',
+      showExport: false, // 导出弹窗初始值
+      queryParam: {
+        months: undefined,
+        targetType: undefined,
+        targetSn: undefined
+      },
+      addrProvinceList: [], //  省下拉
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      rules: {
+        'months': [{ required: true, message: '请选择月份', trigger: 'change' }],
+        'targetType': [{ required: true, message: '请选择费用承担方类型', trigger: 'change' }],
+        'targetSn': [{ required: true, message: '请选择费用承担方名称', trigger: 'change' }]
+      },
+      columns: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        const _this = this
+        _this.disabled = true
+        _this.spinning = true
+        const paramsPage = Object.assign(parameter, this.queryParam) //  有分页
+        return expenseCollectReportQueryPageByTarget(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+          }
+          this.spinning = false
+          this.getCount(paramsPage)
+          return data
+        })
+      },
+      totalData: null,
+      totalMData: []
+    }
+  },
+  methods: {
+    getColumns () {
+      const arr = [
+        {
+          title: '单据类型',
+          dataIndex: 'BILL_TYPE',
+          width: '8%',
+          align: 'center',
+          customRender: function (text) {
+            return text || '--'
+          }
+        },
+        {
+          title: '费用类型',
+          dataIndex: 'COST_TYPE_NAME',
+          align: 'center',
+          customRender: function (text) {
+            return text || '--'
+          },
+          width: '8%',
+          ellipsis: true
+        },
+        {
+          title: '费用承担方类型',
+          dataIndex: 'TARGET_TYPE',
+          width: '10%',
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '费用承担方名称',
+          dataIndex: 'TARGET_NAME',
+          width: '10%',
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '区域',
+          dataIndex: 'SUBAREA_NAME',
+          width: '6%',
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        }
+      ]
+
+      if (this.queryParam.months) {
+        // 月份排序
+        this.queryParam.months.sort((a, b) => {
+          return a.replace('-', '') - b.replace('-', '')
+        })
+        for (let i = 0; i < this.queryParam.months.length; i++) {
+          const item = this.queryParam.months[i]
+          arr.push({
+            title: item.replace('-', '年') + '月',
+            dataIndex: 'M_' + item.replace('-', '_'),
+            width: '6%',
+            align: 'center',
+            customRender: function (text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          })
+        }
+      }
+      arr.push({
+        title: '总计',
+        dataIndex: 'COUNT_PRICE',
+        width: '6%',
+        align: 'center',
+        customRender: function (text) {
+          return ((text || text == 0) ? text : '--')
+        }
+      })
+      this.columns = arr
+    },
+    // 选择月份
+    openMonth () {
+      this.$refs.months.showModal(this.queryParam.months, 'm1')
+    },
+    getDateValue (data) {
+      console.log(data)
+      this.queryParam.months = data
+    },
+    targetChange (v) {
+      // 清空费用承担方名称
+      this.queryParam.targetSn = undefined
+      this.$refs.custList.resetForm()
+    },
+    custChange (v, obj, id) {
+      this.queryParam.targetSn = v.key
+      this.$refs.ruleForm.validateField('targetSn')
+    },
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.getColumns()
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
+    getCount (params) {
+      this.totalData = null
+      this.totalMData = []
+      expenseCollectReportQueryCountByTarget(params).then(res => {
+        this.totalData = res.data
+        for (var key in res.data) {
+          if (key.indexOf('M_') >= 0) {
+            this.totalMData.push(res.data[key])
+          }
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam = {
+        months: undefined,
+        targetType: undefined,
+        targetSn: undefined
+      }
+      this.totalData = null
+      this.totalMData = []
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+      this.getColumns()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.showExport = true
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(expenseCollectReportExportByTarget, params, '费用汇总报表(按承担方)', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    pageInit () {
+      this.getColumns()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style style="less">
+  .regionTypeSalesReportList-wrap{
+
+  }
+</style>

+ 299 - 0
src/views/reportData/expenseAccountReport/categoryList.vue

@@ -0,0 +1,299 @@
+<template>
+  <a-card>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="returnGoodsPresentationList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="统计月份" prop="months">
+                <a-input :value="queryParam.months?queryParam.months.join(','):''" placeholder="请选择月份(多选)" style="width: 100%;">
+                  <span style="cursor: pointer;" slot="addonAfter" @click="openMonth">
+                    点击选择
+                  </span>
+                </a-input>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="费用归属品类(二级)" prop="productTypeSn2">
+                <ProductType v-model="productType" :level="2" @change="changeProductType" placeholder="请选择费用归属品类"></ProductType>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="returnGoodsPresentationList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="returnGoodsPresentationList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_expenseCollectExportByPtype')"
+                id="returnGoodsPresentationList-export">导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :defaultLoadData="false"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :showPagination="false"
+        :data="loadData"
+        bordered>
+        <template slot="footer">
+          <table v-if="totalData">
+            <tr>
+              <th colspan="4" width="32%" style="text-align: right;">{{ totalData['PRODUCT_TYPE_NAME2'] }}汇总:</th>
+              <th width="8%" style="text-align: center;"></th>
+              <th v-for="item in totalMData" width="6%" style="text-align: center;">{{ item }}</th>
+              <th width="6%" style="text-align: center;">{{ totalData['COUNT_PRICE'] }}</th>
+            </tr>
+          </table>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 导出提示框 -->
+    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+    <selectMonth ref="months" @ok="getDateValue"></selectMonth>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import selectMonth from './selectMonth.vue'
+import { hdExportExcel } from '@/libs/exportExcel'
+import reportModal from '@/views/common/reportModal.vue'
+import ProductType from '@/views/common/productType.js'
+import { expenseCollectReportQueryPageByProductType, expenseCollectReportQueryCountByProductType, expenseCollectReportExportByProductType } from '@/api/reportData'
+export default {
+  name: 'AllCountryCostReportList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, selectMonth, ProductType, reportModal },
+  data () {
+    return {
+      spinning: false,
+      open: false,
+      year: '',
+      showExport: false, // 导出弹窗初始值
+      productType: [],
+      queryParam: {
+        months: undefined,
+        productTypeSn2: undefined
+      },
+      addrProvinceList: [], //  省下拉
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      rules: {
+        'months': [{ required: true, message: '请选择月份', trigger: 'change' }],
+        'productTypeSn2': [{ required: true, message: '请选择费用归属品类(二级)', trigger: 'change' }]
+      },
+      columns: [],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        const _this = this
+        _this.disabled = true
+        _this.spinning = true
+        const paramsPage = Object.assign(parameter, this.queryParam) //  有分页
+        return expenseCollectReportQueryPageByProductType(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+          }
+          this.spinning = false
+          this.getCount(paramsPage)
+          return data
+        })
+      },
+      totalData: null,
+      totalMData: []
+    }
+  },
+  methods: {
+    getColumns () {
+      const arr = [
+        {
+          title: '单据类型',
+          dataIndex: 'BILL_TYPE',
+          width: '8%',
+          align: 'center',
+          customRender: function (text) {
+            return text || '--'
+          }
+        },
+        {
+          title: '费用类型',
+          dataIndex: 'COST_TYPE_NAME',
+          align: 'center',
+          customRender: function (text) {
+            return text || '--'
+          },
+          width: '8%',
+          ellipsis: true
+        },
+        {
+          title: '费用归属品牌',
+          dataIndex: 'PRODUCT_BRAND_NAME',
+          width: '8%',
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '费用归属品类(二级)',
+          dataIndex: 'PRODUCT_TYPE_NAME2',
+          width: '8%',
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '费用归属品类(三级)',
+          dataIndex: 'PRODUCT_TYPE_NAME3',
+          width: '8%',
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        }
+      ]
+
+      if (this.queryParam.months) {
+        // 月份排序
+        this.queryParam.months.sort((a, b) => {
+          return a.replace('-', '') - b.replace('-', '')
+        })
+        for (let i = 0; i < this.queryParam.months.length; i++) {
+          const item = this.queryParam.months[i]
+          arr.push({
+            title: item.replace('-', '年') + '月',
+            dataIndex: 'M_' + item.replace('-', '_'),
+            width: '6%',
+            align: 'center',
+            customRender: function (text) {
+              return ((text || text == 0) ? text : '--')
+            }
+          })
+        }
+      }
+      arr.push({
+        title: '总计',
+        dataIndex: 'COUNT_PRICE',
+        width: '6%',
+        align: 'center',
+        customRender: function (text) {
+          return ((text || text == 0) ? text : '--')
+        }
+      })
+      this.columns = arr
+    },
+    // 选择月份
+    openMonth () {
+      this.$refs.months.showModal(this.queryParam.months, 'm1')
+    },
+    getDateValue (data) {
+      this.queryParam.months = data
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+    },
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.getColumns()
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
+    getCount (params) {
+      this.totalData = null
+      this.totalMData = []
+      expenseCollectReportQueryCountByProductType(params).then(res => {
+        this.totalData = res.data
+        for (var key in res.data) {
+          if (key.indexOf('M_') >= 0) {
+            this.totalMData.push(res.data[key])
+          }
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam = {
+        months: undefined,
+        productTypeSn2: undefined
+      }
+      this.totalData = null
+      this.productType = []
+      this.totalMData = []
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+      this.getColumns()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.showExport = true
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(expenseCollectReportExportByProductType, params, '费用汇总报表(按品类)', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    pageInit () {
+      this.getColumns()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style style="less">
+  .regionTypeSalesReportList-wrap{
+
+  }
+</style>

+ 192 - 0
src/views/reportData/expenseAccountReport/selectMonth.vue

@@ -0,0 +1,192 @@
+<template>
+  <a-modal
+    :title="title"
+    style="top: 20px;"
+    v-model="visible"
+    :width="'900px'"
+    :zIndex="12000"
+    :footer="null"
+    @cancel="cancel"
+    centered
+  >
+    <a-row>
+      <a-col :span="5">
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="年份"
+        >
+          <a-select
+            style="width:80px"
+            :getPopupContainer="triggerNode=>triggerNode.parentNode"
+            @change="selectTime"
+            placeholder="请选择"
+            v-model="OneY" >
+            <a-select-option v-for="(i,j) in DateList" :key="j" :value="i.TimeYear">{{ i.TimeYear }}</a-select-option>
+          </a-select>
+        </a-form-item>
+      </a-col>
+      <a-col :span="19">
+        <div class="conterList">
+          <a-checkbox-group v-model="optTime[curIndex].queryTime" @change="onChange" >
+            <a-checkbox
+              v-for="(item,index) in DateList[curIndex].queryTime"
+              :key="index"
+              :value="`${DateList[curIndex].TimeYear}-${(item<=9)?`0${item}`:item}`"
+              class="onSelect">
+              {{ item }}月
+            </a-checkbox>
+          </a-checkbox-group>
+        </div>
+      </a-col>
+    </a-row>
+    <!-- <a-row style="margin-top:5px;">
+      <a-col :span="24">
+        <div><label style="margin: 5px 5px 0 0;display:inline-block;"><span style="color:#f00">*</span>已选择:</label>
+          <a-tag
+            color="#40a9ff"
+            style="margin-bottom: 3px;"
+            closable
+            @close="()=>closeTime(curIndex,v)"
+            v-for="v in optTimes"
+            :key="v + '-1'">{{ v }}</a-tag>
+        </div>
+      </a-col>
+    </a-row> -->
+    <div class="btn-cont">
+      <a-button @click="cancel" style="margin-right: 15px;">取消</a-button>
+      <a-button type="primary" @click="handleSubmit">确定</a-button>
+    </div>
+  </a-modal>
+</template>
+<script>
+export default {
+  data () {
+    return {
+      visible: false,
+      title: '月份选择',
+      DateList: [],
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 10 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 13 }
+      },
+      optTime: [],
+      OneY: null,
+      curIndex: 0,
+      optTimes: null,
+      ctype: null
+
+    }
+  },
+  created () {
+    this.init()
+  },
+  methods: {
+    cancel () {
+      this.visible = false
+    },
+    // info 选中的数据 type 可传可不传 主要做区分
+    showModal (info, type) {
+      this.visible = true
+      this.ctype = type
+      this.optTimes = info || null
+      if (info) this.editTime(info)
+    },
+    init () {
+      const _this = this
+      const _opt = {}
+      const _optTime = {}
+      const arr = new Array(12)
+      const optDate = this.getDateList()
+      optDate.map((item, index) => {
+        _opt[index] = { TimeYear: item, queryTime: [] }
+        _optTime[index] = { TimeYear: item, queryTime: [] }
+        for (let i = 1; i <= arr.length; i++) {
+          _opt[index].queryTime.push(i)
+        }
+      })
+      _this.optTime = _optTime
+      _this.DateList = _opt
+    },
+    getDateList () {
+      const Dates = new Date()
+      const year = Dates.getFullYear()
+      this.OneY = year
+      const optDate = []
+      for (let i = 2022; i <= year; i++) {
+        optDate.push(i)
+      }
+      return optDate.reverse()
+    },
+    editTime (info) {
+      const _optTime = this.optTime
+      const _opt = this.optTimes.map(v => { return v.substring(0, 4) })
+      for (const item in _optTime) {
+        _opt.map((items, indexs) => {
+          if (items == _optTime[item].TimeYear) {
+            _optTime[item].queryTime.push(this.optTimes[indexs])
+          }
+        })
+      }
+      // console.log(_optTime,'_optTime_optTime')
+    },
+    handleSubmit () {
+      const _this = this
+      _this.visible = false
+      _this.$emit('ok', _this.optTimes, _this.ctype)
+      _this.optTimes = []
+      for (const i in _this.optTime) {
+        _this.optTime[i].queryTime = []
+      }
+    },
+    selectTime (info, Node) {
+      const _this = this
+      _this.OneY = info
+      _this.curIndex = parseInt(Node.key)
+    },
+    onChange (info) {
+      const _this = this
+      const _opt = _this.optTime
+      const arr = []
+      for (const item in _opt) {
+        if (_opt[item].queryTime.length > 0) _opt[item].queryTime.filter(v => { arr.push(v) })
+      }
+      _this.optTimes = arr
+    },
+    closeTime (index, time) {
+      this.optTime[index].queryTime = this.optTime[index].queryTime.filter(v => {
+        return v !== time
+      })
+      // let _opt = this.optTime;
+      // let s = {};
+      // for ( let i in _opt ){
+      //  if(_opt[i].queryTime.length > 0) _opt[i].queryTime.filter(v=>{
+      //         return v !== time
+      //     })
+      // }
+      this.optTimes = this.optTimes.filter(v => {
+        return v !== time
+      })
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+.conterList{
+    display: block;
+    width: 100%;
+    border-radius: 6px;
+    .onSelect{
+        width: 110px;
+        margin: 0 0 10px 0;
+    }
+}
+.btn-cont {
+    text-align: center;
+    margin: 35px 0 10px;
+  }
+</style>

+ 19 - 12
src/views/reportData/warehousingOrder/list.vue

@@ -17,24 +17,29 @@
                 <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-model-item label="入库单号">
                 <a-input id="warehousingOrderList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入入库单号"/>
               </a-form-model-item>
             </a-col>
-            <a-col :md="5" :sm="24">
-              <a-form-model-item label="入库类型">
-                <v-select
-                  v-model="queryParam.putBizType"
-                  ref="putBizType"
-                  id="warehousingOrderList-putBizType"
-                  code="PUT_STOCK_TYPE_REPORT"
-                  placeholder="请选择入库类型"
-                  allowClear></v-select>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="单位名称">
+                <a-input id="warehousingOrderList-supplierName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入单位名称"/>
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="8" :sm="24">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="入库类型">
+                  <v-select
+                    v-model="queryParam.putBizType"
+                    ref="putBizType"
+                    id="warehousingOrderList-putBizType"
+                    code="PUT_STOCK_TYPE_REPORT"
+                    placeholder="请选择入库类型"
+                    allowClear></v-select>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
                 <a-form-model-item label="散件入库子类型">
                   <v-select
                     v-model="queryParam.sparePartsType"
@@ -46,7 +51,7 @@
                 </a-form-model-item>
               </a-col>
             </template>
-            <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button
                 type="primary"
                 class="button-info"
@@ -121,6 +126,7 @@ export default {
         beginDate: '',
         endDate: '',
         stockPutNo: '',
+        supplierName: '',
         putBizType: undefined,
         sparePartsType: undefined
       },
@@ -212,6 +218,7 @@ export default {
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
       this.queryParam.stockPutNo = ''
+      this.queryParam.supplierName = ''
       this.queryParam.putBizType = undefined
       this.queryParam.sparePartsType = undefined
       this.totalData = null

+ 7 - 3
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -20,7 +20,6 @@
             class="button-info"
             id="salesDetail-fhfl-print-btn"
             :disabled="localDataSource.length==0"
-            v-if="$hasPermissions('B_dispatchTypePrint')"
             @click="handlePrint('DISPATCH_BILL_TYPE')">发货分类打印</a-button>
           <a-divider type="vertical" />
           <a-button
@@ -257,16 +256,21 @@ export default {
         this.$refs.typePrint.setData(this.detailData, this.outBizSubSn || this.bizSn || this.$route.params.sn)
       }
     },
-    // 发货分类打印
+    // 发货分类打印,导出
     handlePrintOk (obj, taskName, type) {
       const _this = this
       const params = {
         type: this.nowPrintType,
         dispatchBillSn: this.outBizSubSn || this.bizSn || this.$route.params.sn
       }
-
+      // 打印
       if (type != 'export') {
         _this.spinning = true
+
+        // 货位编号
+        if (obj.orderBy) {
+          params.type = params.type + '_STACK_PLACE'
+        }
         printFun(
           dispatchDetailPrint,
           Object.assign(params, obj || {}),

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

@@ -127,7 +127,7 @@
             type="link"
             class="button-warning"
             :loading="!!tipData"
-            v-if="record.printStatus=='UNABLE_PRINT'&&$hasPermissions('B_UNABLE_PRINT')"
+            v-if="record.printStatus=='UNABLE_PRINT'&&record.voidFlag=='0'&&$hasPermissions('B_UNABLE_PRINT')"
             @click="handlePrint(record)"
           >允许备货打印</a-button>
           <span v-else>--</span>

+ 18 - 4
src/views/salesManagement/pushOrderManagement/sendTypeModal.vue

@@ -40,6 +40,13 @@
             </a-select-option>
           </a-select>
         </a-form-model-item>
+        <a-form-model-item label="货位编号" prop="orderBy" v-if="nowType=='print'">
+          <a-radio-group v-model="form.orderBy">
+            <a-radio value="dispatch_bill_detail.STACK_PLACE_CODE ASC">打印(↑升序)</a-radio>
+            <a-radio value="dispatch_bill_detail.STACK_PLACE_CODE DESC">打印(↓降序)</a-radio>
+            <a-radio value="-1">不打印</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
         <a-button id="pushOrderManagement-print-back" @click="handleCancel">取消</a-button>
@@ -47,13 +54,13 @@
           type="primary"
           class="button-info"
           id="pushOrderManagement-print-save"
-          v-if="nowType=='print'"
+          v-if="nowType=='print'&&$hasPermissions('B_dispatchTypePrintView')"
           @click="handleSave('preview')"
           style="margin-left: 15px;">打印预览</a-button>
         <a-button
           type="primary"
           id="pushOrderManagement-print-save"
-          v-if="!hasNoPrint&&nowType=='print'"
+          v-if="!hasNoPrint&&nowType=='print'&&$hasPermissions('B_dispatchTypePrint')"
           @click="handleSave('print')"
           style="margin-left: 10px;">确定打印</a-button>
         <a-button
@@ -92,10 +99,12 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       form: {
-        id: 'all'
+        id: 'all',
+        orderBy: undefined
       },
       rules: {
-        id: [{ required: true, message: '请选择产品分类', trigger: 'change' }]
+        id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
+        orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }]
       },
       formItemLayout: {
         labelCol: { span: 6 },
@@ -120,6 +129,10 @@ export default {
               dispatchBillSn: this.detailData.dispatchBillSn,
               dispatchBillNo: this.detailData.dispatchBillNo
             }
+            // 打印货位编号
+            if (_this.form.orderBy != '-1') {
+              obj.orderBy = _this.form.orderBy
+            }
             _this.$emit('ok', obj, '发货分类', type)
           }
           _this.isShow = false
@@ -134,6 +147,7 @@ export default {
       this.isShow = false
       this.$refs.ruleForm.resetFields()
       this.form.id = 'all'
+      this.form.orderBy = undefined
     },
     // 获取该销售单产品二级分类
     getTypeData (dispatchBillSn) {

+ 6 - 2
src/views/salesManagement/receiptPrint/list.vue

@@ -158,8 +158,8 @@
           width="1024px"
           :showFooter="false"
           :openModal="showTipModal"
-          @cancel="showTipModal=false">
-          <printModel ref="printModel" @cancel="showTipModal=false" @printOk="printOk"></printModel>
+          @cancel="closeTipModal">
+          <printModel ref="printModel" @cancel="closeTipModal" @printOk="printOk"></printModel>
         </commonModal>
         <!-- 打印记录 -->
         <recordModal ref="recordModal" modalTit="打印记录" :openModal="showRecordModal" @cancel="showRecordModal=false"></recordModal>
@@ -320,6 +320,10 @@ export default {
     printOk () {
       this.$refs.table.refresh()
     },
+    closeTipModal () {
+      this.showTipModal = false
+      this.$refs.printModel.clearData()
+    },
     // 打印记录
     viewPrint (row) {
       this.showRecordModal = true

+ 9 - 3
src/views/salesManagement/receiptPrint/printModel.vue

@@ -36,9 +36,11 @@
                         <td style="padding:3pt;width: 24pt;">{{ dindex+1 }}</td>
                         <td style="padding:3pt;width: 44pt;">{{ moment(item.receiptDate).format('M月D日') }}</td>
                         <td style="padding:3pt;width: 114pt;text-align:left;">
-                          {{ item.dealerEntity.dealerName }}<br>
-                          {{ item.dealerEntity.kdMidCustomerFnumber }}<br>
-                          {{ item.dealerEntity.licenseName }}
+                          <div v-if="item.dealerEntity">
+                            {{ item.dealerEntity.dealerName }}<br>
+                            {{ item.dealerEntity.kdMidCustomerFnumber }}<br>
+                            {{ item.dealerEntity.licenseName }}
+                          </div>
                         </td>
                         <td style="padding:3pt;width: 146pt;text-align:left;">
                           订单金额:{{ item.orderAmount?item.orderAmount.toFixed(2):'0.00' }}<br>
@@ -144,6 +146,10 @@ export default {
       this.$emit('cancel')
       this.detail = null
       this.financeBookList = []
+    },
+    clearData () {
+      this.detail = null
+      this.financeBookList = []
     }
   }
 }

+ 29 - 11
src/views/salesManagement/salesQuery/detail.vue

@@ -85,7 +85,10 @@
                 <span v-if="$hasPermissions('B_isShowPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? detailData.totalUndispatchAmount : '--' }}</strong>;</span>
                 <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? detailData.totalCityAmount : '--' }}</strong>;</span>
               </div>
-              <a-checkbox v-model="isCityPrice" v-if="$hasPermissions('B_isShowPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
+              <div>
+                <a-button v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
+                <a-checkbox v-model="isCityPrice" v-if="$hasPermissions('B_isShowPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
+              </div>
             </div>
           </div>
         </a-alert>
@@ -102,15 +105,14 @@
           bordered>
           <!-- 产品编码 -->
           <template slot="productCode" slot-scope="text, record">
-            <div v-if="(record.promotionFlag == 1) || (Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))" class="flexBox">
-              <div>{{ text }}</div>
-              <a-badge count="促" :number-style="{ backgroundColor: '#f90' }" v-if="record.promotionFlag == 1">
-              </a-badge>
+            <div v-if="(record.promotionFlag == 1) || (Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))">
+              <span>{{ text }}</span>
+              <a-badge count="促" :number-style="{ backgroundColor: '#f90' }" v-if="record.promotionFlag == 1"></a-badge>
               <!-- 可审核时才可显示“缺”货产品 -->
-              <a-badge count="缺" v-if="(Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))">
+              <a-badge count="缺" v-if="(Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))">
               </a-badge>
             </div>
-            <span v-if="!(record.promotionFlag == 1 || ((Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))))">{{ text }}</span>
+            <span v-if="!(record.promotionFlag == 1 || ((Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))))">{{ text }}</span>
           </template>
           <!-- 当前库存 -->
           <template slot="stockQty" slot-scope="text, record">
@@ -185,6 +187,8 @@
       @fail="auditOrder('AUDIT_REJECT')" />
     <!-- 审核加下推 -->
     <dsModal ref="dsModal" title="销售单一键审核" :openModal="showDsModal" @close="showDsModal=false" @ok="handleOnceAudit" />
+    <!-- 缺货明细 -->
+    <stockOutDetail :openModal="showStockOut" :detailData="detailData" :salesBillSn="$route.params.sn || bizSn" @close="showStockOut=false"></stockOutDetail>
   </div>
 </template>
 
@@ -196,12 +200,13 @@ import { STable, VSelect } from '@/components'
 import printModal from './printModal.vue'
 import auditModal from '@/views/common/auditModal.vue'
 import dsModal from '@/views/salesManagement/waitDispatch/dsModal.vue'
+import stockOutDetail from './stockOutDetailModal.vue'
 import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel, salesWriteAudit, salesWriteAuditPush } from '@/api/sales'
 import { salesDetailAllList, salesDetailAllStockList } from '@/api/salesDetail'
 export default {
   name: 'SalesDetail',
   mixins: [commonMixin],
-  components: { STable, VSelect, printModal, auditModal, dsModal },
+  components: { STable, VSelect, printModal, auditModal, dsModal, stockOutDetail },
   props: {
     bizSn: { //  有值则为弹框,无值则为页面
       type: [Number, String],
@@ -213,12 +218,13 @@ export default {
       spinning: false,
       disabled: false,
       showDsModal: false,
+      showStockOut: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         const params = Object.assign(parameter, { salesBillSn: this.$route.params.sn || this.bizSn })
         let url = salesDetailAllList
-        if (this.detailData && this.detailData.billStatus == 'WAIT_AUDIT' && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
+        if (this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
           url = salesDetailAllStockList
         } else { // 非审核
           url = salesDetailAllList
@@ -282,7 +288,7 @@ export default {
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'left' },
+        { title: '产品编码', dataIndex: 'productCode', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
         { title: '产品名称', dataIndex: 'productName', width: '13%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -309,7 +315,7 @@ export default {
           arr.splice(ind + 1, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         }
       }
-      if (this.detailData && this.detailData.billStatus == 'WAIT_AUDIT' && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
+      if (this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
         arr.splice(arr.length - 3, 0, { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })
       }
       return arr
@@ -325,6 +331,18 @@ export default {
       const row = this.detailData
       this.$router.push({ name: 'salesEdit', params: { sn: row.salesBillSn } })
     },
+    // 打开缺货明细
+    openStockOut () {
+      if (this.outStockStr != '') {
+        this.showStockOut = true
+      } else {
+        this.$info({
+          title: '提示',
+          content: '此销售单暂无缺货产品!',
+          centered: true
+        })
+      }
+    },
     //  详情
     getDetail () {
       salesDetailBySn({ salesBillSn: this.$route.params.sn || this.bizSn }).then(res => {

+ 29 - 1
src/views/salesManagement/salesQuery/list.vue

@@ -89,6 +89,15 @@
               <span class="table-page-search-submitButtons">
                 <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
                 <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a-button
+                  style="margin-left: 10px"
+                  type="primary"
+                  class="button-warning"
+                  @click="handleExport"
+                  :disabled="disabled"
+                  :loading="exportLoading"
+                  v-if="$hasPermissions('B_actualSalesReport_export')"
+                >导出</a-button>
                 <a @click="advanced=!advanced" style="margin-left: 8px">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -238,6 +247,8 @@
         </div>
       </div>
     </commonModal>
+    <!-- 导出提示框 -->
+    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
   </a-card>
 </template>
 
@@ -252,12 +263,15 @@ import { STable, VSelect } from '@/components'
 import commonModal from '@/views/common/commonModal.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import reportModal from '@/views/common/reportModal.vue'
 import { salesList, salesDel, salesCount } from '@/api/sales'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { findBySalesBillSn, dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
+import { salesDetailExport } from '@/api/salesBillReport'
 export default {
   name: 'SalesQueryList',
   mixins: [commonMixin],
-  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, rangeDate, subarea, commonModal },
+  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, rangeDate, subarea, commonModal, reportModal },
   data () {
     return {
       spinning: false,
@@ -265,6 +279,8 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 选择客户弹框是否显示
       showTipModal: false, // 备货打印弹框
+      showExport: false,
+      exportLoading: false,
       tableHeight: 0,
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
@@ -377,6 +393,18 @@ export default {
     }
   },
   methods: {
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.showExport = true
+      const params = _this.queryParam
+      _this.exportLoading = true
+      _this.spinning = true
+      hdExportExcel(salesDetailExport, params, '销售明细', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    },
     //  时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]

+ 32 - 6
src/views/salesManagement/salesQuery/printModal.vue

@@ -35,9 +35,27 @@
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="产品售价" prop="priceType">
-          <a-radio-group v-model="form.priceType">
-            <a-radio :value="nowType=='SALES_BILL_TYPE' ? 'SALES_BILL_TYPE_COST' : 'SALES_BILL_COST'">{{ nowType=='export' ? '导出' : '打印' }}</a-radio>
-            <a-radio :value="nowType=='SALES_BILL_TYPE' ? 'SALES_BILL_TYPE' : 'SALES_BILL'">不{{ nowType=='export' ? '导出' : '打印' }}</a-radio>
+          <!-- 销售分类打印 -->
+          <a-radio-group v-model="form.priceType" v-if="nowType=='SALES_BILL_TYPE'">
+            <a-radio value="SALES_BILL_TYPE_COST">打印</a-radio>
+            <a-radio value="SALES_BILL_TYPE">不打印</a-radio>
+          </a-radio-group>
+          <!-- 销售打印 -->
+          <a-radio-group v-model="form.priceType" v-if="nowType=='SALES_BILL'">
+            <a-radio value="SALES_BILL_COST">打印</a-radio>
+            <a-radio value="SALES_BILL">不打印</a-radio>
+          </a-radio-group>
+          <!-- 销售导出 -->
+          <a-radio-group v-model="form.priceType" v-if="nowType=='export'">
+            <a-radio :value="form.dataScope == 'ENOUGH' ? 'SALES_BILL_COST_NOT_LACK':'SALES_BILL_COST'">导出</a-radio>
+            <a-radio :value="form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK':'SALES_BILL'">不导出</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+        <a-form-model-item label="货位编号" prop="orderBy" v-if="nowType=='SALES_BILL_TYPE'">
+          <a-radio-group v-model="form.orderBy">
+            <a-radio value="sbd.STACK_PLACE_CODE ASC">打印(↑升序)</a-radio>
+            <a-radio value="sbd.STACK_PLACE_CODE DESC">打印(↓降序)</a-radio>
+            <a-radio value="-1">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
       </a-form-model>
@@ -74,16 +92,18 @@ export default {
       form: {
         id: 'all',
         dataScope: 'all',
-        priceType: undefined
+        priceType: undefined,
+        orderBy: undefined
       },
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
-        priceType: [{ required: true, message: '请选择产品售价', trigger: 'change' }]
+        priceType: [{ required: true, message: '请选择产品售价', trigger: 'change' }],
+        orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }]
       },
       formItemLayout: {
         labelCol: { span: 6 },
-        wrapperCol: { span: 18 }
+        wrapperCol: { span: 15 }
       },
       spinning: false,
       typeList: []
@@ -108,6 +128,7 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
+          // 分类打印
           if (_this.nowType == 'SALES_BILL_TYPE') {
             const item = _this.typeList.find(item => item.id == _this.form.id)
             if (item) {
@@ -118,6 +139,11 @@ export default {
                 priceType: _this.form.priceType,
                 type: isPrint || 'preview'
               }
+              // 打印货位编号
+              if (_this.form.orderBy != '-1') {
+                obj.orderBy = _this.form.orderBy
+                obj.priceType = obj.priceType + '_STACK_PLACE'
+              }
               _this.$emit('ok', obj)
             }
           } else if (_this.nowType == 'SALES_BILL') {

+ 118 - 0
src/views/salesManagement/salesQuery/stockOutDetailModal.vue

@@ -0,0 +1,118 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    title="销售单缺货明细"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="50%">
+    <a-descriptions size="small" :column="2">
+      <a-descriptions-item label="销售单号">
+        {{ detailData&&detailData.salesBillNo || '--' }}
+        <span v-if="detailData&&detailData.salesBillNoSource">(原:{{ detailData&&detailData.salesBillNoSource || '--' }})</span>
+      </a-descriptions-item>
+      <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
+    </a-descriptions>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 500 }"
+        :showPagination="false"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+      <div class="btn-cont" style="padding:20px 20px 0;text-align: center;">
+        <a-button @click="isShow=false">关闭</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { salesStockoutDetail } from '@/api/salesDetail'
+export default {
+  name: 'StockOutDetail',
+  components: { STable },
+  props: {
+    openModal: {
+      type: Boolean,
+      default: false
+    },
+    salesBillSn: {
+      type: [Number, String],
+      default: ''
+    },
+    detailData: {
+      type: Object,
+      default: function () {
+        return null
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货数量', dataIndex: 'lackQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货金额', dataIndex: 'lackAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        delete parameter.tableId
+        delete parameter.index
+        return salesStockoutDetail({ isOos: 1, salesBillSn: this.salesBillSn }).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  watch: {
+    openModal (nVal, oVal) {
+      this.isShow = nVal
+    },
+    isShow (nVal, oVal) {
+      if (!nVal) {
+        this.$emit('close')
+        this.$refs.table.clearTable()
+      } else {
+        this.$nextTick(() => {
+          this.$refs.table.refresh()
+        })
+      }
+    },
+    itemSn (nVal, oVal) {
+
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 4 - 0
src/views/salesManagement/stockPrint/list.vue

@@ -303,6 +303,10 @@ export default {
         type: 'DISPATCH_BILL_TYPE',
         dispatchBillSn: obj.dispatchBillSn
       }
+      // 货位编号
+      if (obj.orderBy) {
+        params.type = params.type + '_STACK_PLACE'
+      }
       _this.spinning = true
       printFun(
         dispatchDetailPrint,

+ 29 - 3
src/views/salesReturnManagement/salesReturn/chooseDepartUserModal.vue

@@ -52,6 +52,19 @@
                 placeholder="请选择抄送人"
               ></dingDepartUser>
             </a-form-model-item>
+            <a-form-model-item label="附件" help="(支持图片、word、excel、PDF等格式,最多10个附件)">
+              <Upload
+                style="height: 100%;"
+                v-model="form.attachmentList"
+                ref="attachList"
+                :fileSize="10"
+                :maxNums="10"
+                fileType="*"
+                uploadType="attach"
+                :action="attachAction"
+                @change="changeAttach"
+                upText="上传附件"></Upload>
+            </a-form-model-item>
           </a-form-model>
         </div>
         <div class="btn-cont">
@@ -65,12 +78,12 @@
 </template>
 
 <script>
-import { VSelect } from '@/components'
+import { VSelect, Upload } from '@/components'
 import dingDepartUser from '@/views/common/dingDepartUser.js'
 import employee from '@/views/expenseManagement/expenseReimbursement/employee.js'
 export default {
   name: 'ChooseDepartUserModal',
-  components: { dingDepartUser, employee, VSelect },
+  components: { dingDepartUser, employee, VSelect, Upload },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -93,6 +106,8 @@ export default {
         approvers: [], // 审批人
         ccList: [] // 抄送人
       },
+      attachList: [],
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
       rules: {
         salesReturnType: [
           { required: true, message: '请选择退货类型', trigger: 'change' }
@@ -113,6 +128,13 @@ export default {
         this.$refs.ruleForm.validateField(['applyPersonSn'])
       })
     },
+    //  附件上传
+    changeAttach (file) {
+      this.attachList = JSON.parse(file)
+      this.attachList.map(item => {
+        item.fileType = item.extName
+      })
+    },
     updateUser () {
       this.uploading = true
       this.$refs.departUserApp.updateDeptUser()
@@ -136,6 +158,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
+          form.attachmentList = this.attachList
           if (form.approvers) {
             form.approvers = this.getTreeVal(form.approvers)
           }
@@ -153,12 +176,15 @@ export default {
     resetForm () {
       this.$nextTick(() => {
         this.$refs.ruleForm.resetFields()
+        this.$refs.attachList.setFileList('')
       })
+      this.attachList = []
       this.form = {
         salesReturnType: undefined,
         applyPersonSn: undefined,
         ccList: undefined,
-        approvers: undefined
+        approvers: undefined,
+        attachmentList: ''
       }
     },
     cancel () {

+ 26 - 8
src/views/salesReturnManagement/salesReturn/detail.vue

@@ -51,6 +51,12 @@
               <a-descriptions-item label="创建时间">{{ detailData&&detailData.createDate || '--' }}</a-descriptions-item>
               <a-descriptions-item label="审核时间">{{ detailData&&detailData.auditTime || '--' }}</a-descriptions-item>
               <a-descriptions-item label="退货类型">{{ detailData&&detailData.salesReturnTypeDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="附件" :span="3">
+                <a target="_blank" style="color: #00aaff;text-decoration: underline;margin-right: 15px;" :href="item.filePath" v-for="item in detailData.attachmentList" :key="item.id">
+                  {{ item.fileName }}
+                </a>
+                <span v-if="detailData.attachmentList.length==0">--</span>
+              </a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
@@ -105,8 +111,8 @@
         </a-tabs>
       </a-card>
     </a-spin>
-    <!-- 打印 -->
-    <div id="print"></div>
+    <!-- 打印导出 -->
+    <print-modal :openModal="openModal" :itemData="detailData" :nowType="nowType" @ok="handleOk" @close="openModal=false" />
   </div>
 </template>
 
@@ -115,16 +121,18 @@ import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { printFun, exportExcel } from '@/libs/JGPrint.js'
 import auditDetail from '@/views/common/auditDetail.vue'
+import printModal from './printModal.vue'
 import { salesReturnDetail, salesReturnChangeLogList, salesReturnPrint, salesReturnExport } from '@/api/salesReturn'
 import { salesReturnDetailList } from '@/api/salesReturnDetail'
 export default {
   name: 'SalesReturnDetail',
   mixins: [commonMixin],
-  components: { STable, VSelect, auditDetail },
+  components: { STable, VSelect, auditDetail, printModal },
   data () {
     return {
       spinning: false,
       disabled: false,
+      openModal: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -145,6 +153,7 @@ export default {
       },
       chooseLoadData: [],
       detailData: null, //  详情数据
+      nowType: '',
       visibleAudit: false,
       spinningAudit: false,
       curTab: 1,
@@ -231,19 +240,28 @@ export default {
     },
     // 打印预览/快捷打印
     handlePrint (type) {
-      const _this = this
       const a = ['WAIT_CUSTOMER_SERVICE_CONFIRM', 'WAIT_FINANCIAL_AUDIT', 'FINANCIAL_REJECT', 'FINISH'].find(item => item == this.detailData.billStatus)
-      const status = a ? 'SALES_RETURN_AMOUNT' : 'SALES_RETURN_REASON'
-      const params = { sn: this.$route.params.sn, status: status }
+      this.nowType = type
+      // 选择是否导出价格
+      if (a) {
+        this.openModal = true
+      } else {
+        this.handleOk({ priceType: 'SALES_RETURN_REASON' })
+      }
+    },
+    // 确定打印或预览
+    handleOk (objs) {
+      const _this = this
+      const params = { salesReturnBillSn: this.$route.params.sn, ...objs }
       _this.spinning = true
       // 导出
-      if (type == 'export') {
+      if (this.nowType == 'export') {
         exportExcel(salesReturnExport, params, '销售退货', function () {
           _this.spinning = false
         })
       } else {
         // 打印或预览
-        printFun(salesReturnPrint, params, type, '销售退货', () => {
+        printFun(salesReturnPrint, params, this.nowType, '销售退货', () => {
           _this.spinning = false
         })
       }

+ 1 - 1
src/views/salesReturnManagement/salesReturn/importGuideModal.vue

@@ -127,7 +127,7 @@ export default {
     handleExport () {
       const link = document.createElement('a')
       link.style.display = 'none'
-      link.href = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/XiaoShouTuiHuoMingXiDaoRu.xlsx'
+      link.href = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/template/XiaoShouTuiHuoMingXiDaoRu.xlsx?t=' + new Date().getTime()
       link.setAttribute('download', '销售退货单产品导入模板' + '.xlsx')
       document.body.appendChild(link)
       link.click()

+ 32 - 11
src/views/salesReturnManagement/salesReturn/list.vue

@@ -91,16 +91,27 @@
             </a-col>
           </a-row>
         </a-form>
-      </div>
-      <!-- 操作按钮 -->
-      <div class="table-operator">
-        <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesReturnNew')" @click="openModal = true">新增</a-button>
+        <!-- 操作按钮 -->
+        <div class="table-operator">
+          <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesReturnNew')" @click="openModal = true">新增</a-button>
+        </div>
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            总单数:{{ countData&&countData.totalRecord||0 }};
+            申请退货数量:{{ countData&&countData.totalInitialQty||0 }};
+            仓库实收数量:{{ countData&&countData.totalReceiveQty||0 }};
+            坏件数量:{{ countData&&countData.totalBadQty||0 }};
+            良品数量:{{ countData&&countData.totalGoodQty||0 }};
+            返库数量:{{ countData&&countData.totalBackStockQty||0 }};
+            实际退货金额:{{ countData&&countData.totalAmount||0 }}元;
+          </div>
+        </a-alert>
       </div>
       <!-- 列表 -->
       <s-table
         class="sTable fixPagination"
         ref="table"
-        :style="{ height: tableHeight+64.5+'px' }"
+        :style="{ height: tableHeight+94.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
@@ -193,7 +204,7 @@ import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import verifyModal from './verifyModal.vue'
 import chooseDepartUserModal from './chooseDepartUserModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { salesReturnList, updateAgain, salesReturnDel, salesReturnSubmit } from '@/api/salesReturn'
+import { salesReturnList, salesReturnQueryCount, updateAgain, salesReturnDel, salesReturnSubmit } from '@/api/salesReturn'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 export default {
@@ -241,7 +252,8 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return salesReturnList(Object.assign(parameter, this.queryParam)).then(res => {
+        const params = Object.assign(parameter, this.queryParam)
+        return salesReturnList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -252,13 +264,16 @@ export default {
             this.disabled = false
           }
           this.spinning = false
+          // 统计
+          this.getCount(params)
           return data
         })
       },
       addrProvinceList: [], //  省下拉
       visibleAudit: false,
       auditInfo: null,
-      spinningAudit: false
+      spinningAudit: false,
+      countData: null
     }
   },
   computed: {
@@ -267,23 +282,29 @@ export default {
         { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '是否同步给客户', dataIndex: 'syncFlag', width: '7%', align: 'center', customRender: function (text) { return text ? ['否', '是'][text] : '--' } },
+        { title: '是否同步给客户', dataIndex: 'syncFlag', width: '5%', align: 'center', customRender: function (text) { return text ? ['否', '是'][text] : '--' } },
         { title: '客户采退申请单号', dataIndex: 'purchaseReturnApplyNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '10%', align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'buyerName', width: '9%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'totalBadQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '良品数量', dataIndex: 'totalGoodQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '返库数量', dataIndex: 'totalBackStockQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实际退货金额', dataIndex: 'totalAmount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       return arr
     }
   },
   methods: {
+    getCount (params) {
+      salesReturnQueryCount(params).then(res => {
+        this.countData = res.data
+      })
+    },
     //  创建时间  change
     dateCreateChange (date) {
       this.queryParam.beginDate = date[0]

+ 142 - 0
src/views/salesReturnManagement/salesReturn/printModal.vue

@@ -0,0 +1,142 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    class="sales-print-type-modal"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="sales-print-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="销售退货单号">{{ itemData&&itemData.salesReturnBillNo || '--' }}</a-form-model-item>
+        <a-form-model-item label="销售退货对象">{{ itemData&&itemData.buyerName || '--' }}</a-form-model-item>
+        <a-form-model-item label="退货价格" prop="priceType" v-if="nowType=='export'">
+          <a-radio-group v-model="form.priceType">
+            <a-radio value="SALES_RETURN_AMOUNT">导出</a-radio>
+            <a-radio value="SALES_RETURN">不导出</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+        <a-form-model-item label="退货价格" prop="priceType" v-if="nowType!='export'">
+          <a-radio-group v-model="form.priceType">
+            <a-radio value="SALES_RETURN_AMOUNT">打印</a-radio>
+            <a-radio value="SALES_RETURN">不打印</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+        <a-form-model-item label="货位编号" prop="orderBy" v-if="nowType!='export'">
+          <a-radio-group v-model="form.orderBy">
+            <a-radio value="ASC">打印(↑升序)</a-radio>
+            <a-radio value="DESC">打印(↓降序)</a-radio>
+            <a-radio value="-1">不打印</a-radio>
+          </a-radio-group>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button id="sales-print-back" @click="handleCancel">取消</a-button>
+        <a-button type="primary" id="sales-print-save" @click="handleSave()" style="margin-left: 15px;">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+export default {
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemData: {
+      type: Object,
+      default: () => {
+        return null
+      }
+    },
+    nowType: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      form: {
+        priceType: undefined,
+        orderBy: undefined
+      },
+      rules: {
+        priceType: [{ required: true, message: '请选择退货价格', trigger: 'change' }],
+        orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }]
+      },
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
+      },
+      spinning: false,
+      typeList: []
+    }
+  },
+  computed: {
+    modalTit () {
+      return this.nowType == 'export' ? '导出Excel' : '销售退货打印'
+    }
+  },
+  methods: {
+    // 确认
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const obj = {
+            priceType: _this.form.priceType
+          }
+          // 打印货位编号
+          if (_this.form.orderBy != '-1' && this.nowType != 'export') {
+            obj.orderBy = _this.form.orderBy
+            obj.priceType = obj.priceType + '_STACK_PLACE'
+          }
+          _this.$emit('ok', obj)
+          _this.isShow = false
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 取消选择分类
+    handleCancel () {
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .sales-print-type-modal{
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 1 - 1
src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue

@@ -450,7 +450,7 @@ export default {
       const _this = this
       const a = ['WAIT_CUSTOMER_SERVICE_CONFIRM', 'WAIT_FINANCIAL_AUDIT', 'FINANCIAL_REJECT', 'FINISH'].find(item => item == this.ordeDetail.billStatus)
       const status = a ? 'SALES_RETURN_AMOUNT' : 'SALES_RETURN_REASON'
-      const params = { sn: this.$route.params.sn, status: status }
+      const params = { salesReturnBillSn: this.$route.params.sn, priceType: status }
       _this.spinning = true
       // 导出
       if (type == 'export') {

+ 2 - 2
vue.config.js

@@ -107,9 +107,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.0.182:8602/ocs-admin',
+        // target: 'http://192.168.0.215:8602/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  Á·Ï°
-        // target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
+        target: 'http://p.ocs.360arrow.com/ocs-admin', //  Ô¤·¢²¼
         ws: false,
         changeOrigin: true,
         pathRewrite: {