Quellcode durchsuchen

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

李磊 vor 10 Monaten
Ursprung
Commit
a0dbd217b5
100 geänderte Dateien mit 3188 neuen und 2203 gelöschten Zeilen
  1. BIN
      public/templ/采购产品导入模板.xlsx
  2. 1 1
      public/version.json
  3. 202 0
      src/api/purchase.js
  4. 25 0
      src/api/salesNew.js
  5. 27 16
      src/api/spareParts.js
  6. 1 1
      src/components/Select/index.js
  7. 6 4
      src/components/UploadFile/index.vue
  8. 36 0
      src/config/router.config.js
  9. 41 28
      src/store/modules/app.js
  10. 2 3
      src/views/allocationManagement/allocateReturnConfirmation/detailModal.vue
  11. 332 304
      src/views/allocationManagement/allocateReturnConfirmation/list.vue
  12. 43 53
      src/views/allocationManagement/allocationList/list.vue
  13. 55 45
      src/views/allocationManagement/matchSendOutOrder/list.vue
  14. 5 5
      src/views/allocationManagement/transferOut/basicInfoModal.vue
  15. 6 3
      src/views/allocationManagement/transferOut/chooseImportModal.vue
  16. 20 9
      src/views/allocationManagement/transferOut/detail.vue
  17. 25 19
      src/views/allocationManagement/transferOut/dsModal.vue
  18. 58 36
      src/views/allocationManagement/transferOut/edit.vue
  19. 14 5
      src/views/allocationManagement/transferOut/importGuideModal.vue
  20. 55 44
      src/views/allocationManagement/transferOut/list.vue
  21. 31 23
      src/views/allocationManagement/transferOut/printModal.vue
  22. 20 15
      src/views/allocationManagement/transferOut/printStatusModal.vue
  23. 49 29
      src/views/allocationManagement/transferReturn/basicInfoModal.vue
  24. 37 29
      src/views/allocationManagement/transferReturn/check.vue
  25. 5 3
      src/views/allocationManagement/transferReturn/chooseImportModal.vue
  26. 15 7
      src/views/allocationManagement/transferReturn/detail.vue
  27. 52 38
      src/views/allocationManagement/transferReturn/edit.vue
  28. 45 40
      src/views/allocationManagement/transferReturn/editGrp.vue
  29. 14 5
      src/views/allocationManagement/transferReturn/importGuideModal.vue
  30. 34 24
      src/views/allocationManagement/transferReturn/list.vue
  31. 10 7
      src/views/allocationManagement/transferReturn/print.vue
  32. 20 17
      src/views/allocationManagement/transferReturn/printModal.vue
  33. 65 49
      src/views/allocationManagement/transfersPrint/list.vue
  34. 10 4
      src/views/allocationManagement/transfersPrint/recordModal.vue
  35. 12 4
      src/views/basicData/transferTypeManagement/editModal.vue
  36. 9 3
      src/views/basicData/transferTypeManagement/list.vue
  37. 18 12
      src/views/basicData/warehouse/editModal.vue
  38. 8 2
      src/views/basicData/warehouse/list.vue
  39. 7 1
      src/views/basicData/warehouse/storingLocation/editModal.vue
  40. 14 7
      src/views/basicData/warehouse/storingLocation/list.vue
  41. 3 1
      src/views/common/chooseProductsModal.vue
  42. 14 5
      src/views/common/supplier.js
  43. 30 24
      src/views/dataExport/exportCheck/list.vue
  44. 34 29
      src/views/dataExport/exportSales/list.vue
  45. 27 18
      src/views/dealerManagement/businessOwnerSettings/addModal.vue
  46. 39 16
      src/views/dealerManagement/businessOwnerSettings/categorySet.vue
  47. 19 11
      src/views/dealerManagement/businessOwnerSettings/chooseAreaModal.vue
  48. 43 28
      src/views/dealerManagement/businessOwnerSettings/chooseDealer.vue
  49. 27 13
      src/views/dealerManagement/businessOwnerSettings/chooseSupplier.vue
  50. 26 14
      src/views/dealerManagement/businessOwnerSettings/list.vue
  51. 37 29
      src/views/dealerManagement/businessOwnerSettings/settingsIndex.vue
  52. 68 67
      src/views/dealerManagement/businessOwnerSettings/supplierSet.vue
  53. 1 0
      src/views/dealerManagement/dealerAccountManagement/detailModal.vue
  54. 26 16
      src/views/dealerManagement/dealerAccountManagement/editModal.vue
  55. 16 12
      src/views/dealerManagement/dealerAccountManagement/list.vue
  56. 23 21
      src/views/dealerManagement/dealerZoneSearch/list.vue
  57. 13 7
      src/views/dealerManagement/marketingDivisionSetNew/addAreaModal.vue
  58. 16 9
      src/views/dealerManagement/marketingDivisionSetNew/addZoneModal.vue
  59. 15 10
      src/views/dealerManagement/marketingDivisionSetNew/list.vue
  60. 39 32
      src/views/dealerManagement/marketingDivisionSetNew/viewDealers.vue
  61. 27 14
      src/views/dealerManagement/merchantInfoManagement/chooseTypeModal.vue
  62. 17 25
      src/views/dealerManagement/merchantInfoManagement/detailModal.vue
  63. 70 66
      src/views/dealerManagement/merchantInfoManagement/edit.vue
  64. 59 15
      src/views/dealerManagement/merchantInfoManagement/list.vue
  65. 22 15
      src/views/dealerManagement/merchantInfoManagement/permissionSettingNew.vue
  66. 9 7
      src/views/dealerManagement/merchantInfoManagement/priceLevelModal.vue
  67. 21 14
      src/views/dealerManagement/merchantInfoManagement/updateCooperate.vue
  68. 20 12
      src/views/dealerManagement/merchantInfoManagement/updateDealerLevel.vue
  69. 9 2
      src/views/dealerManagement/provincialWarehouseManagement/addModal.vue
  70. 32 22
      src/views/dealerManagement/provincialWarehouseManagement/chooseDealer.vue
  71. 15 9
      src/views/dealerManagement/provincialWarehouseManagement/list.vue
  72. 41 30
      src/views/dealerManagement/provincialWarehouseManagement/relatedDealersList.vue
  73. 19 11
      src/views/dealerManagement/rebateBinding/categoryList.vue
  74. 21 14
      src/views/dealerManagement/rebateBinding/categoryTree.vue
  75. 35 21
      src/views/dealerManagement/rebateBinding/list.vue
  76. 33 15
      src/views/dealerManagement/rebateBinding/priceDiffModal.vue
  77. 45 27
      src/views/dowloadFile/list.vue
  78. 24 14
      src/views/expenseManagement/expenseReimbursement/add.vue
  79. 29 21
      src/views/expenseManagement/expenseReimbursement/baseDataModal.vue
  80. 12 8
      src/views/expenseManagement/expenseReimbursement/chooseDepartUserModal.vue
  81. 7 2
      src/views/expenseManagement/expenseReimbursement/chooseImportModal.vue
  82. 8 8
      src/views/expenseManagement/expenseReimbursement/detail.vue
  83. 27 8
      src/views/expenseManagement/expenseReimbursement/epenseCdfModal.vue
  84. 5 4
      src/views/expenseManagement/expenseReimbursement/epenseDetailModal.vue
  85. 4 6
      src/views/expenseManagement/expenseReimbursement/importGuideModal.vue
  86. 74 57
      src/views/expenseManagement/expenseReimbursement/list.vue
  87. 7 14
      src/views/expenseManagement/expenseReimbursement/productInfoModal.vue
  88. 1 1
      src/views/expenseManagement/expenseReimbursement/verifyModal.vue
  89. 37 27
      src/views/expenseManagement/expenseReimbursementDetail/list.vue
  90. 2 3
      src/views/financialManagement/financialCollection/selectGlSalesModal.vue
  91. 143 113
      src/views/financialManagement/warehousingConfirmation/list.vue
  92. 11 11
      src/views/inventoryManagement/inventoryCheck/addModal.vue
  93. 15 13
      src/views/inventoryManagement/inventoryCheck/detail.vue
  94. 130 133
      src/views/inventoryManagement/inventoryCheck/list.vue
  95. 15 4
      src/views/inventoryManagement/inventoryQuery/detailModal.vue
  96. 4 5
      src/views/inventoryManagement/inventoryQuery/exportExcelModal.vue
  97. 126 125
      src/views/inventoryManagement/inventoryQuery/list.vue
  98. 12 12
      src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue
  99. 19 12
      src/views/power/OperateJournal/OperateJournal.vue
  100. 36 26
      src/views/power/dataDictionary/codeItemModal.vue

BIN
public/templ/采购产品导入模板.xlsx


+ 1 - 1
public/version.json

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

+ 202 - 0
src/api/purchase.js

@@ -0,0 +1,202 @@
+import { axios } from '@/utils/request'
+
+//  采购入库 列表  分页
+export const purchaseList = (params) => {
+  const url = `/purchase/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+//  采购入库 列表合计
+export const purchasePageCount = (params) => {
+  return axios({
+    url: '/purchase/queryPageCount',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表合计')
+    }
+  })
+}
+//  采购入库 列表 取消
+export const purchaseCancel = (params) => {
+  const url = `/purchase/cancel/${params.sn}`
+  return axios({
+    url: url,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('取消')
+    }
+  })
+}
+
+// 采购入库 明细列表 分页
+export const purchaseDetailPageList = (params) => {
+  const url = `/purchase/queryDetailPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+//  采购入库 明细列表  基础信息
+export const queryDetailCount = (params) => {
+  const url = `/purchase/queryBySn/${params.sn}`
+  return axios({
+    url: url,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('基础信息')
+    }
+  })
+}
+//  采购入库 明细列表 统计信息
+export const purchaseDetailPageCount = (params) => {
+  return axios({
+    url: `/purchase/queryDetailPageCount`,
+    data: params,
+    method: 'post'
+  })
+}
+// 新增/编辑 采购入库详情
+export const savePurchaseDetail = (params) => {
+  return axios({
+    url: '/purchase/saveDetail',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('新增/编辑')
+    }
+  })
+}
+// 编辑基础信息
+export const detailBaseSave = (params) => {
+  return axios({
+    url: '/purchase/setSupplierInfo',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('基础信息编辑')
+    }
+  })
+}
+
+// 采购入库提交
+export const purchaseSubmit = (params) => {
+  return axios({
+    url: `/purchase/submit/${params.sn}`,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('提交')
+    }
+  })
+}
+// 采购入库  明细详情
+export const getDetailData = (params) => {
+  const url = `/purchase/queryDetailBySn/${params.sn}`
+  return axios({
+    url: url,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('明细详情')
+    }
+  })
+}
+
+// 采购入库 编辑页面 删除 sparePartsDetailSn
+export const purchaseDetailDel = (params) => {
+  const url = `/purchase/deleteDetail/${params.sn}`
+  return axios({
+    url: url,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('删除')
+    }
+  })
+}
+
+//  采购入库   解析导入的文件
+export const purchaseImportData = (params) => {
+  return axios({
+    url: '/purchase/detail/parseProducts',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('导入和不可导入列表')
+    }
+  })
+}
+// 采购入库 导出错误项
+export const exportPurchaseData = params => {
+  const url = `/purchase/detail/downloadFailExcel`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出错误项')
+    }
+  })
+}
+// 采购入库 确定要导入的数据
+
+export const purchaseImportBatchInsert = (params) => {
+  return axios({
+    url: 'purchase/detail/batchInsert',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('确定导入')
+    }
+  })
+}
+
+// 采购入库 审核
+export const purchaseAudit = (params) => {
+  return axios({
+    url: '/purchase/audit',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('审核')
+    }
+  })
+}
+
+// 采购入库 上传凭证
+export const saveAttachment = (params) => {
+  return axios({
+    url: '/purchase/saveAttachment',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('上传凭证')
+    }
+  })
+}
+// 采购入库  轮胎唯一码
+export const traceCodeQueryList = (params) => {
+  return axios({
+    url: '/traceCode/queryList',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('查看唯一码')
+    }
+  })
+}

+ 25 - 0
src/api/salesNew.js

@@ -22,6 +22,31 @@ export const salesList = (params) => {
         }
     })
 }
+// 第三方库存
+export const getThirdStockQty = (params) => {
+    return axios({
+        url: `/sunFulcess/getStockQty`,
+        data: params,
+        method: 'post'
+    })
+}
+
+// 是否已转采购单
+export const getCreatePurchaseFlag = (params) => {
+    return axios({
+        url: `/sales/getCreatePurchaseFlag`,
+        data: params,
+        method: 'post'
+    })
+}
+// 转采购单
+export const allCreatePurchase = (params) => {
+    return axios({
+        url: `/sales/allCreatePurchase`,
+        data: params,
+        method: 'post'
+    })
+}
 //  销售 待转费用单列表  有分页
 export const salesConvertExpenseList = (params) => {
     const url = `/salesPromo/queryBatchConvertExpenseAccountPage/${params.pageNo}/${params.pageSize}`

+ 27 - 16
src/api/spareParts.js

@@ -9,7 +9,7 @@ export const sparePartsList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('列表查询')
     }
   })
@@ -21,7 +21,7 @@ export const sparePartsDetailExport = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
+    headers: {
       'module': encodeURIComponent('导出明细')
     }
   })
@@ -32,7 +32,7 @@ export const sparePartsAudit = (params) => {
   return axios({
     url: `/spareParts/audit/${params.sn}`,
     method: 'get',
-    headers:{
+    headers: {
       'module': encodeURIComponent('审核')
     }
   })
@@ -43,7 +43,7 @@ export const sparePartsBatchAudit = (params) => {
     url: `/spareParts/batchAudit`,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('批量审核')
     }
   })
@@ -54,7 +54,7 @@ export const sparePartsAuditVerify = (params) => {
     url: `/spareParts/auditVerify`,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('审核校验')
     }
   })
@@ -66,7 +66,7 @@ export const sparePartsAuditFail = (params) => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
+    headers: {
       'module': encodeURIComponent('导出审核错误项')
     }
   })
@@ -78,7 +78,7 @@ export const sparePartsDelete = (params) => {
     url: `/spareParts/delete/${params.sn}`,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('删除')
     }
   })
@@ -90,7 +90,7 @@ export const sparePartsDeleteDetail = (params) => {
     url: `/spareParts/deleteDetail/${params.sn}`,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('删除')
     }
   })
@@ -105,7 +105,7 @@ export const sparePartsDetailList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('明细列表查询')
     }
   })
@@ -119,6 +119,17 @@ export const sparePartsPageCount = (params) => {
     method: 'post'
   })
 }
+//  散件入库 明细列表  基础信息
+export const queryDetailCount = (params) => {
+  const url = `/spareParts/queryBySn/${params.sn}`
+  return axios({
+    url: url,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('基础信息')
+    }
+  })
+}
 
 // 新增散件入库单
 export const sparePartsSave = (params) => {
@@ -126,8 +137,8 @@ export const sparePartsSave = (params) => {
     url: `/spareParts/save`,
     data: params,
     method: 'post',
-    headers:{
-      'module': encodeURIComponent(params.id?'编辑':'新增')
+    headers: {
+      'module': encodeURIComponent(params.id ? '编辑' : '新增')
     }
   })
 }
@@ -138,8 +149,8 @@ export const sparePartsSaveDetail = (params) => {
     url: `/spareParts/saveDetail`,
     data: params,
     method: 'post',
-    headers:{
-      'module': encodeURIComponent(params.id?'编辑':'新增产品')
+    headers: {
+      'module': encodeURIComponent(params.id ? '编辑' : '新增产品')
     }
   })
 }
@@ -173,7 +184,7 @@ export const sparePartsDetailBatchInsert = params => {
     url: '/spareParts/detail/batchInsert',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('导入')
     }
   })
@@ -186,7 +197,7 @@ export const sparePartsDetailFailExcel = (params) => {
     method: 'post',
     data: params.list,
     responseType: 'blob',
-    headers:{
+    headers: {
       'module': encodeURIComponent('导出错误项')
     }
   })
@@ -201,7 +212,7 @@ export const queryDetailStockPage = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('明细列表查询')
     }
   })

+ 1 - 1
src/components/Select/index.js

@@ -28,7 +28,7 @@ export default {
     },
     isEnable: { // 是否只获取已启用的数据
       type: Boolean,
-      default: false
+      default: true
     },
     notIn: {
       type: Array,

+ 6 - 4
src/components/UploadFile/index.vue

@@ -179,10 +179,12 @@ export default {
         }
         this.previewVisible = true
       } else {
-        const src = file.response.data
-        if (!Array.isArray(src)) {
-          this.previewImage = file.url || file.thumbUrl
-          this.previewVisible = true
+        if (file.response && file.response.status && file.response.status == 200) {
+          var src = file.response.data
+          if (Array.isArray(src)) {
+            src = file.response.data[0].filePath
+          }
+          window.location.href = src.replace('http:', 'https:')
         }
       }
     },

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

@@ -862,6 +862,42 @@ export const asyncRouterMap = [
           permission: 'M_purchasingManagement'
         },
         children: [
+          {
+            path: '/purchasingManagement/purchaseReceipt',
+            redirect: '/purchasingManagement/purchaseReceipt/list',
+            name: 'purchaseReceipt',
+            component: BlankLayout,
+            meta: {
+              title: '采购入库',
+              icon: 'gold',
+              permission: 'M_purchaseReceipt'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'purchaseReceiptList',
+                component: () => import(/* webpackChunkName: "purchasingManagement" */ '@/views/purchasingManagement/purchaseReceipt/list.vue'),
+                meta: {
+                  title: '采购入库列表',
+                  icon: 'gold',
+                  hidden: true,
+                  permission: 'M_purchaseReceiptList'
+                }
+              },
+              {
+                path: 'edit',
+                name: 'purchaseReceiptEdit',
+                component: () => import(/* webpackChunkName: "purchasingManagement" */ '@/views/purchasingManagement/purchaseReceipt/edit.vue'),
+                meta: {
+                  title: '编辑采购入库单',
+                  icon: 'gold',
+                  hidden: true
+                  // permission: 'B_purchaseReceiptEdit'
+                }
+              }
+            ]
+          },
           {
             path: '/purchasingManagement/bulkWarehousingOrder',
             redirect: '/purchasingManagement/bulkWarehousingOrder/list',

+ 41 - 28
src/store/modules/app.js

@@ -36,7 +36,7 @@ const app = {
     employeeList: [], // 申请人列表
     defectiveReturnReason: [], // 不良品申请退货列表
     goodReturnReason: [], // 良品申请退货列表
-    bookReason:[], // 收款事由
+    bookReason: [], // 收款事由
     tempBillOfData: null, // 临时存储收货单数据
     authMenusList: [], // 权限菜单数据
     priceAuthOptions: [], // 价格权限选项
@@ -48,11 +48,11 @@ const app = {
     warehouseAuthList: null, // 有权限的仓库列表
     warehouseAllList: null, // 无权限所有仓库列表
     defWarehouse: null, // 默认仓库
-    isWarehouse: false,// 仓库管理权限
-    isShowCustomerSearch:false ,//客服查询权限
+    isWarehouse: false, // 仓库管理权限
+    isShowCustomerSearch: false, // 客服查询权限
     interFaceList: [
       // 销售单,下推
-     {
+      {
         a: 'sales/findBySn',
         b: [
           'sales/submit',
@@ -78,7 +78,7 @@ const app = {
           'sales/detail/pushOfBatch',
           'dispatch/detail/deleteBatch',
           'dispatch/detail/updateQty'
-          ],
+        ],
         timeStr: ''
       },
       // 销售退货
@@ -109,18 +109,19 @@ const app = {
           'salesReturn/detail/insertByReceive',
           'salesReturn/detail/insertByCustomerService',
           'salesReturn/detail/updateAllReason'
-          ],
+        ],
         timeStr: ''
       },
       // 散件入库
       {
-        a: 'spareParts/queryDetailPageCount',
+        a: 'spareParts/queryBySn',
         b: [
           'spareParts/saveDetail',
           'spareParts/deleteDetail',
           'spareParts/detail/parseProducts',
-          'spareParts/detail/batchInsert'
-          ],
+          'spareParts/detail/batchInsert',
+          'spareParts/queryDetailPageCount'
+        ],
         timeStr: ''
       },
       // 采购退货
@@ -131,11 +132,23 @@ const app = {
           'sparePartsReturn/detail/delete',
           'sparePartsReturn/detail/save',
           'sparePartsReturn/detail/saveBatch'
-          ],
+        ],
+        timeStr: ''
+      },
+      // 采购入库
+      {
+        a: 'purchase/queryBySn',
+        b: [
+          'purchase/saveDetail',
+          'purchase/deleteDetail',
+          'purchase/detail/batchInsert',
+          'purchase/setSupplierInfo',
+          'purchase/submit'
+        ],
         timeStr: ''
       },
       // 调拨
-     {
+      {
         a: 'allocateBill/findBySn',
         b: [
           'allocateBill/submit',
@@ -147,10 +160,10 @@ const app = {
           'allocateBill/detail/parseProducts',
           'allocateBill/detail/batchInsert',
           ''
-          ],
+        ],
         timeStr: ''
       },
-      //调拨退货
+      // 调拨退货
       {
         a: 'allocateReturn/queryBySn',
         b: [
@@ -161,7 +174,7 @@ const app = {
           'allocReturnDetail/insert',
           'allocReturnDetail/insertBatch',
           'allocReturnDetail/update'
-          ],
+        ],
         timeStr: ''
       },
       // 发货单
@@ -171,7 +184,7 @@ const app = {
           'sendBill/update',
           'sendBill/updateIssueRemark',
           'sendBill/updateTransportInfo'
-          ],
+        ],
         timeStr: ''
       },
       // 提货单
@@ -242,7 +255,7 @@ const app = {
     SET_employeeList: (state, val) => {
       state.employeeList = val
     },
-    SET_returnReason:(state, obj) => {
+    SET_returnReason: (state, obj) => {
       state[obj.key] = obj.val
     },
     SET_showPdfPrint: (state, val) => {
@@ -304,18 +317,18 @@ const app = {
         }
       })
     },
-    getLookUpDataByCode({ commit }, params) {
-        getLookUpData({
-          pageNo: 1,
-          pageSize: 1000,
-          lookupCode: params.code,
-          isEnable: params.isEnable
-        }).then(res => {
-          if (res.status == 200) {
-            commit('SET_returnReason', {key: params.key, val: res.data.list})
-          }
-        })
-    },
+    getLookUpDataByCode ({ commit }, params) {
+      getLookUpData({
+        pageNo: 1,
+        pageSize: 1000,
+        lookupCode: params.code,
+        isEnable: params.isEnable
+      }).then(res => {
+        if (res.status == 200) {
+          commit('SET_returnReason', { key: params.key, val: res.data.list })
+        }
+      })
+    }
   }
 }
 

+ 2 - 3
src/views/allocationManagement/allocateReturnConfirmation/detailModal.vue

@@ -16,6 +16,7 @@
 </template>
 
 <script>
+// 组件
 import detail from '@/views/allocationManagement/transferReturn/detail'
 export default {
   name: 'AllocateReturnDetailModal',
@@ -35,8 +36,6 @@ export default {
       isShow: this.openModal //  是否打开弹框
     }
   },
-  methods: {
-  },
   watch: {
     //  父页面传过来的弹框状态
     openModal (newValue, oldValue) {
@@ -47,7 +46,7 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$store.state.app.curActionPermission = ''
-      }else{
+      } else {
         this.$store.state.app.curActionPermission = 'M_allocateReturnConfirmationDetail'
       }
     }

+ 332 - 304
src/views/allocationManagement/allocateReturnConfirmation/list.vue

@@ -3,50 +3,72 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper" >
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="transferReturnConfirmation-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+                <rangeDate id="transferReturnConfirmation-rangeDate" ref="rangeDate" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="调拨退货单号">
-                <a-input id="transferReturnConfirmation-allocateReturnNo" v-model.trim="queryParam.allocateReturnNo"
-                  allowClear placeholder="请输入调拨退货单号" />
+                <a-input
+                  id="transferReturnConfirmation-allocateReturnNo"
+                  v-model.trim="queryParam.allocateReturnNo"
+                  allowClear
+                  placeholder="请输入调拨退货单号" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                <a-input id="transferReturnConfirmation-targetName" v-model.trim="queryParam.targetName" allowClear
+                <a-input
+                  id="transferReturnConfirmation-targetName"
+                  v-model.trim="queryParam.targetName"
+                  allowClear
                   placeholder="请输入客户名称" />
               </a-form-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="是否抓单">
-                  <v-select v-model="queryParam.grabFlag" ref="grabFlag" id="transferReturnConfirmation-grabFlag"
-                    code="FLAG" placeholder="请选择" allowClear></v-select>
+                  <v-select
+                    v-model="queryParam.grabFlag"
+                    ref="grabFlag"
+                    id="transferReturnConfirmation-grabFlag"
+                    code="FLAG"
+                    placeholder="请选择"
+                    allowClear></v-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="状态">
-                  <v-select v-model="queryParam.state" ref="state" id="transferReturnConfirmation-state"
-                    code="ALLOCATE_RETURN_STATE_CONFIRM" placeholder="请选择状态" allowClear></v-select>
+                  <v-select
+                    v-model="queryParam.state"
+                    ref="state"
+                    id="transferReturnConfirmation-state"
+                    code="ALLOCATE_RETURN_STATE_CONFIRM"
+                    placeholder="请选择状态"
+                    allowClear></v-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="仓库">
-                  <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
+                  <chooseWarehouse ref="warehouse" id="transferReturnConfirmation-warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
                 </a-form-model-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"
+              <a-button
+                type="primary"
+                @click="$refs.table.refresh(true)"
+                :disabled="disabled"
                 id="transferReturnConfirmation-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled"
+              <a-button
+                style="margin-left: 5px"
+                @click="resetSearchForm"
+                :disabled="disabled"
                 id="transferReturnConfirmation-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="transferReturnConfirmation-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'" />
               </a>
@@ -58,28 +80,36 @@
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 列表 -->
-        <s-table 
-        class="sTable fixPagination" 
-        ref="table" 
-        :style="{ height: tableHeight+70+'px' }" 
-        size="small"
-        :rowKey="(record) => record.id" 
-        :columns="columns" 
-        :pageSize="30"
-        :data="loadData" :scroll="{ y: tableHeight }"
-        :defaultLoadData="false" bordered>
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :pageSize="30"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
           <!-- 销退单号 -->
           <template slot="allocateReturnNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('M_allocateReturnConfirmationDetail')" class="link-bule"
+            <span
+              v-if="$hasPermissions('M_allocateReturnConfirmationDetail')"
+              class="link-bule"
+              :id="'transferReturnConfirmation-allocateReturnNo-'+record.id"
               @click="handleDetail(record)">{{ record.allocateReturnNo }}</span>
             <span v-else>{{ record.allocateReturnNo }}</span>
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button size="small" type="link"
+            <a-button
+              size="small"
+              type="link"
               v-if="record.state=='WAIT_FINANCIAL_AUDIT' && $hasPermissions('B_allocateReturnConfirmationAudit')"
-              class="button-warning" @click="handleAudit(record)"
-              id="transferReturnConfirmation-audit-btn">退货确认</a-button>
+              class="button-warning"
+              @click="handleAudit(record)"
+              :id="'transferReturnConfirmation-submit-'+record.id">退货确认</a-button>
             <span v-else>--</span>
           </template>
         </s-table>
@@ -91,304 +121,302 @@
 </template>
 
 <script>
-  import {
-    commonMixin
-  } from '@/utils/mixin'
-  import rangeDate from '@/views/common/rangeDate.vue'
-  import {
-    STable,
-    VSelect
-  } from '@/components'
-  import AllocateReturnDetailModal from './detailModal.vue'
-  import chooseWarehouse from '@/views/common/chooseWarehouse'
-  import {
-    allocateReturnQueryConfirmPage,
-    allocateReturnFinanceAudit
-  } from '@/api/allocateReturn'
-  export default {
-    name: 'AllocateReturnConfirmationList',
-    mixins: [commonMixin],
-    components: {
-      STable,
-      VSelect,
-      AllocateReturnDetailModal,
-      rangeDate,
-      chooseWarehouse
-    },
-    data() {
-      return {
-        spinning: false,
-        tableHeight: 0,
-        queryParam: { //  查询条件
-          beginDate: '',
-          endDate: '',
-          allocateReturnNo: '', //  单号
-          targetName: '',
-          grabFlag: undefined,
-          state: undefined, //  状态
-          warehouseSn: undefined
-        },
-        disabled: false, //  查询、重置按钮是否可操作
-        advanced: true,
-        // 加载数据方法 必须为 Promise 对象
-        loadData: parameter => {
-          this.disabled = true
-          this.spinning = true
-          return allocateReturnQueryConfirmPage(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,
-        itemSn: ''
-      }
-    },
-    // 根据权限显示列表字段
-    computed: {
-      columns() {
-        const arr = [{
-            title: '序号',
-            dataIndex: 'no',
-            width: '4%',
-            align: 'center'
-          },
-          {
-            title: '创建时间',
-            dataIndex: 'createDate',
-            width: '11%',
-            align: 'center',
-            customRender: function(text) {
-              return text || '--'
-            }
-          },
-          {
-            title: '退货单号',
-            scopedSlots: {
-              customRender: 'allocateReturnNo'
-            },
-            width: '16%',
-            align: 'center'
-          },
-          {
-            title: '调拨退货客户',
-            dataIndex: 'targetName',
-            align: 'center',
-            width: '15%',
-            customRender: function(text) {
-              return text || '--'
-            },
-            ellipsis: true
-          },
-          {
-            title: '仓库',
-            dataIndex: 'warehouseName',
-            align: 'center',
-            width: '15%',
-            customRender: function(text) {
-              return text || '--'
-            },
-            ellipsis: true
-          },
-          {
-            title: '是否抓单',
-            dataIndex: 'grabFlagDictValue',
-            width: '7%',
-            align: 'center',
-            customRender: function(text) {
-              return text || '--'
-            }
-          },
-          {
-            title: '退货总数量',
-            dataIndex: 'totalQty',
-            width: '7%',
-            align: 'center',
-            customRender: function(text) {
-              return ((text || text == 0) ? text : '--')
-            }
-          },
-          {
-            title: '坏件数量',
-            dataIndex: 'totalBadQty',
-            width: '7%',
-            align: 'center',
-            customRender: function(text) {
-              return ((text || text == 0) ? text : '--')
-            }
-          },
-          {
-            title: '返库数量',
-            dataIndex: 'totalBackStockQty',
-            width: '7%',
-            align: 'center',
-            customRender: function(text) {
-              return ((text || text == 0) ? text : '--')
-            }
-          },
-          // { title: '退货总金额', dataIndex: 'totalPrice', width: '7%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-          {
-            title: '确认时间',
-            dataIndex: 'financeAuditTime',
-            width: '11%',
-            align: 'center',
-            customRender: function(text) {
-              return text || '--'
-            }
-          },
-          {
-            title: '状态',
-            dataIndex: 'stateDictValue',
-            width: '6%',
-            align: 'center',
-            customRender: function(text) {
-              return text || '--'
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import rangeDate from '@/views/common/rangeDate.vue'
+import { STable, VSelect } from '@/components'
+import AllocateReturnDetailModal from './detailModal.vue'
+import chooseWarehouse from '@/views/common/chooseWarehouse'
+// 接口
+import { allocateReturnQueryConfirmPage, allocateReturnFinanceAudit } from '@/api/allocateReturn'
+export default {
+  name: 'AllocateReturnConfirmationList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, AllocateReturnDetailModal, rangeDate, chooseWarehouse },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0, // 表格高度
+      //  查询条件
+      queryParam: {
+        beginDate: '', // 创建开始时间
+        endDate: '', // 创建结束时间
+        allocateReturnNo: '', //  单号
+        targetName: '', // 调拨退货客户
+        grabFlag: undefined, // 是否抓单
+        state: undefined, //  状态
+        warehouseSn: undefined// 出库仓库
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true, // 展开关闭
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        // 获取列表数据  有分页
+        return allocateReturnQueryConfirmPage(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
             }
-          },
-          {
-            title: '操作',
-            scopedSlots: {
-              customRender: 'action'
-            },
-            width: '8%',
-            align: 'center'
+            this.disabled = false
           }
-        ]
-        if (this.$hasPermissions('M_allocateReturnConfirmationList_salesPrice')) { //  售价权限
-          arr.splice(9, 0, {
-            title: '退货总金额',
-            dataIndex: 'totalPrice',
-            width: '7%',
-            align: 'right',
-            customRender: text => ((text || text == 0) ? this.toThousands(text) : '--')
-          })
+          this.spinning = false
+          return data
+        })
+      },
+      openModal: false, // 打开详情弹窗
+      itemSn: ''// 当前行sn
+    }
+  },
+  // 根据权限显示列表字段
+  computed: {
+    // 表头
+    columns () {
+      const arr = [{
+        title: '序号',
+        dataIndex: 'no',
+        width: '4%',
+        align: 'center'
+      },
+      {
+        title: '创建时间',
+        dataIndex: 'createDate',
+        width: '11%',
+        align: 'center',
+        customRender: function (text) {
+          return text || '--'
         }
-        return arr
-      }
-    },
-    methods: {
-      //  创建时间  change
-      dateChange(date) {
-        this.queryParam.beginDate = date[0]
-        this.queryParam.endDate = date[1]
       },
-      custChange(val) {
-        this.queryParam.buyerSn = val.key
+      {
+        title: '退货单号',
+        scopedSlots: {
+          customRender: 'allocateReturnNo'
+        },
+        width: '16%',
+        align: 'center'
       },
-      //  重置
-      resetSearchForm() {
-        this.$refs.rangeDate.resetDate()
-        this.queryParam.beginDate = ''
-        this.queryParam.endDate = ''
-        this.queryParam.allocateReturnNo = ''
-        this.queryParam.targetName = ''
-        this.queryParam.grabFlag = undefined
-        this.queryParam.state = undefined
-        this.queryParam.warehouseSn = undefined
-        this.$refs.table.refresh(true)
+      {
+        title: '调拨退货客户',
+        dataIndex: 'targetName',
+        align: 'center',
+        width: '15%',
+        customRender: function (text) {
+          return text || '--'
+        },
+        ellipsis: true
       },
-      // 详情
-      handleDetail(row) {
-        this.itemSn = row.allocateReturnSn
-        this.openModal = true
+      {
+        title: '仓库',
+        dataIndex: 'warehouseName',
+        align: 'center',
+        width: '15%',
+        customRender: function (text) {
+          return text || '--'
+        },
+        ellipsis: true
       },
-      closeModal() {
-        this.itemSn = ''
-        this.openModal = false
+      {
+        title: '是否抓单',
+        dataIndex: 'grabFlagDictValue',
+        width: '7%',
+        align: 'center',
+        customRender: function (text) {
+          return text || '--'
+        }
       },
-      // 退货确认
-      handleAudit(row) {
-        const _this = this
-        this.$confirm({
-          title: '提示',
-          content: '请点击下方按钮确认操作',
-          centered: true,
-          closable: true,
-          okText: '通过',
-          cancelText: '不通过',
-          onOk() {
-            _this.auditOrder(row.allocateReturnSn, 'FINISH')
-          },
-          onCancel(e) {
-            if (!e.triggerCancel) {
-              _this.auditOrder(row.allocateReturnSn, 'FINANCIAL_REJECT')
-            }
-            _this.$destroyAll()
-          }
-        })
+      {
+        title: '退货总数量',
+        dataIndex: 'totalQty',
+        width: '7%',
+        align: 'center',
+        customRender: function (text) {
+          return ((text || text == 0) ? text : '--')
+        }
       },
-      auditOrder(sn, flag) {
-        const _this = this
-        _this.spinning = true
-        allocateReturnFinanceAudit({
-          allocateReturnSn: sn,
-          state: flag
-        }).then(res => {
-          if (res.status == 200) {
-            _this.$message.success(res.message)
-            _this.$refs.table.refresh()
-            _this.spinning = false
-          } else {
-            _this.spinning = false
-          }
-        })
+      {
+        title: '坏件数量',
+        dataIndex: 'totalBadQty',
+        width: '7%',
+        align: 'center',
+        customRender: function (text) {
+          return ((text || text == 0) ? text : '--')
+        }
       },
-      pageInit() {
-        const _this = this
-        this.$nextTick(() => { // 页面渲染完成后的回调
-          _this.setTableH()
-        })
+      {
+        title: '返库数量',
+        dataIndex: 'totalBackStockQty',
+        width: '7%',
+        align: 'center',
+        customRender: function (text) {
+          return ((text || text == 0) ? text : '--')
+        }
+      },
+      // { title: '退货总金额', dataIndex: 'totalPrice', width: '7%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+      {
+        title: '确认时间',
+        dataIndex: 'financeAuditTime',
+        width: '11%',
+        align: 'center',
+        customRender: function (text) {
+          return text || '--'
+        }
+      },
+      {
+        title: '状态',
+        dataIndex: 'stateDictValue',
+        width: '6%',
+        align: 'center',
+        customRender: function (text) {
+          return text || '--'
+        }
       },
-      setTableH() {
-        const tableSearchH = this.$refs.tableSearch.offsetHeight
-        this.tableHeight = window.innerHeight - tableSearchH - 200
+      {
+        title: '操作',
+        scopedSlots: {
+          customRender: 'action'
+        },
+        width: '8%',
+        align: 'center'
       }
-    },
-    watch: {
-      advanced(newValue, oldValue) {
-        const _this = this
-        this.$nextTick(() => { // 页面渲染完成后的回调
-          _this.setTableH()
+      ]
+      if (this.$hasPermissions('M_allocateReturnConfirmationList_salesPrice')) { //  售价权限
+        arr.splice(9, 0, {
+          title: '退货总金额',
+          dataIndex: 'totalPrice',
+          width: '7%',
+          align: 'right',
+          customRender: text => ((text || text == 0) ? this.toThousands(text) : '--')
         })
-      },
-      '$store.state.app.winHeight'(newValue, oldValue) { //  窗口变更时,需同时更改表格高度
-        this.setTableH()
       }
+      return arr
+    }
+  },
+  methods: {
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
-    mounted() {
-      if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-        this.pageInit()
-        this.resetSearchForm()
-      }
+    // 退货客户
+    custChange (val) {
+      this.queryParam.buyerSn = val.key
     },
-    activated() {
-      // 如果是新页签打开,则重置当前页面
-      if (this.$store.state.app.isNewTab) {
-        this.pageInit()
-        this.resetSearchForm()
-      }
-      // 仅刷新列表,不重置页面
-      if (this.$store.state.app.updateList) {
-        this.pageInit()
-        this.$refs.table.refresh()
-      }
+    //  重置
+    resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.allocateReturnNo = ''
+      this.queryParam.targetName = ''
+      this.queryParam.grabFlag = undefined
+      this.queryParam.state = undefined
+      this.queryParam.warehouseSn = undefined
+      this.$refs.table.refresh(true)
     },
-    beforeRouteEnter(to, from, next) {
-      next(vm => {})
+    // 详情
+    handleDetail (row) {
+      this.itemSn = row.allocateReturnSn
+      this.openModal = true
+    },
+    // 关闭详情弹窗
+    closeModal () {
+      this.itemSn = ''
+      this.openModal = false
+    },
+    // 退货确认
+    handleAudit (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '请点击下方按钮确认操作',
+        centered: true,
+        closable: true,
+        okText: '通过',
+        cancelText: '不通过',
+        onOk () {
+          _this.auditOrder(row.allocateReturnSn, 'FINISH')
+        },
+        onCancel (e) {
+          if (!e.triggerCancel) {
+            _this.auditOrder(row.allocateReturnSn, 'FINANCIAL_REJECT')
+          }
+          _this.$destroyAll()
+        }
+      })
+    },
+    // 退货确认成功
+    auditOrder (sn, flag) {
+      const _this = this
+      _this.spinning = true
+      allocateReturnFinanceAudit({
+        allocateReturnSn: sn,
+        state: flag
+      }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    // 初始化
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    // 计算表格高度
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 200
+    }
+  },
+  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()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
   }
+}
 </script>
 
 <style lang="less">
   .transferReturnConfirmation-wrap {
-     
+
   }
-</style>
+</style>

+ 43 - 53
src/views/allocationManagement/allocationList/list.vue

@@ -4,7 +4,7 @@
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form-model
-          id="allocateBillList-form"
+          id="allocationList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -14,13 +14,13 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="创建时间" prop="time">
-                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+                <rangeDate id="allocationList-rangeDate" ref="rangeDate" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="调往对象">
                 <a-input
-                  id="allocateBillList-targetName"
+                  id="allocationList-targetName"
                   v-model.trim="queryParam.targetName"
                   allowClear
                   placeholder="请输入调往对象" />
@@ -29,7 +29,7 @@
             <a-col :md="6" :sm="24">
               <a-form-model-item label="费用/调拨类型">
                 <AllocateType
-                  id="allocateBillList-costTypeName"
+                  id="allocationList-allocateTypeVal"
                   v-model="allocateTypeVal"
                   :changeOnSelect="true"
                   placeholder="请选择费用/调拨类型"
@@ -39,7 +39,7 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="收货客户名称">
-                  <dealerSearchList ref="receiverSn" @change="custChange" />
+                  <dealerSearchList id="allocationList-receiverSn" ref="receiverSn" @change="custChange" />
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -47,7 +47,7 @@
                   <v-select
                     v-model="queryParam.state"
                     ref="state"
-                    id="allocateBillList-state"
+                    id="allocationList-state"
                     code="ALLOCATE_STATUS2"
                     placeholder="请选择业务状态"
                     allowClear></v-select>
@@ -56,7 +56,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="调拨单号">
                   <a-input
-                    id="allocateBillList-allocateNo"
+                    id="allocationList-allocateNo"
                     v-model.trim="queryParam.allocateNo"
                     allowClear
                     placeholder="请输入调拨单号" />
@@ -64,7 +64,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="调出仓库">
-                  <warehouse v-model="queryParam.warehouseSn" id="allocateBillList-warehouseSn" placeholder="请选择调出仓库" />
+                  <warehouse v-model="queryParam.warehouseSn" id="allocationList-warehouseSn" placeholder="请选择调出仓库" />
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -72,7 +72,7 @@
                   <v-select
                     v-model="queryParam.printState"
                     ref="printState"
-                    id="allocateBillList-printState"
+                    id="allocationList-printState"
                     code="PRINT_STATUS"
                     placeholder="请选择打印状态"
                     allowClear></v-select>
@@ -83,7 +83,7 @@
                   <v-select
                     v-model="queryParam.checkStatus"
                     ref="checkStatus"
-                    id="allocateBillList-checkStatus"
+                    id="allocationList-checkStatus"
                     code="CHECK_STATUS"
                     placeholder="请选择对单状态"
                     allowClear></v-select>
@@ -95,13 +95,13 @@
                 type="primary"
                 @click="handleSearch"
                 :disabled="disabled"
-                id="allocateBillList-refresh">查询</a-button>
+                id="allocationList-refresh">查询</a-button>
               <a-button
                 style="margin-left: 5px"
                 @click="resetSearchForm"
                 :disabled="disabled"
-                id="allocateBillList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+                id="allocationList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="allocationList-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'" />
               </a>
@@ -132,13 +132,14 @@
           </template>
           <!-- 调拨单号 -->
           <template slot="allocateNo" slot-scope="text, record">
-            <span class="link-bule" @click="handleDetail(record,2)">{{ record.allocateNo }}</span>
+            <span class="link-bule" :id="'allocationList-allocateNo-'+record.id" @click="handleDetail(record,2)">{{ record.allocateNo }}</span>
           </template>
           <!-- 发货单号  -->
           <template slot="sendBillNo" slot-scope="text, record">
             <span
               v-if="record.sendBill&&record.sendBill.sendBillNo"
               class="link-bule"
+              :id="'allocationList-sendBillNo-'+record.id"
               @click="handleDetail(record,1)">{{ record.sendBill.sendBillNo }}</span>
             <span v-else>--</span>
           </template>
@@ -169,84 +170,69 @@
 </template>
 
 <script>
-import {
-  commonMixin
-} from '@/utils/mixin'
+import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
+// 组件
 import rangeDate from '@/views/common/rangeDate.vue'
-import {
-  STable,
-  VSelect
-} from '@/components'
+import { STable, VSelect } from '@/components'
 import commonModal from '@/views/common/commonModal.vue'
 import detailModal from '@/views/salesManagement/sendOutOrder/detailModal.vue'
 import AllocateType from '@/views/common/allocateType.js'
 import dealerSearchList from '@/views/common/dealerSearchList.vue'
 import warehouse from '@/views/common/chooseWarehouse.js'
-import {
-  queryOverviewPage
-} from '@/api/allocateBill'
 import allocationDetailModal from '@/views/allocationManagement/transferOut/detail.vue'
+// 接口
+import { queryOverviewPage } from '@/api/allocateBill'
 export default {
-  name: 'PushOrderManagementList',
+  name: 'AllocationList',
   mixins: [commonMixin],
-  components: {
-    STable,
-    VSelect,
-    allocationDetailModal,
-    AllocateType,
-    warehouse,
-    dealerSearchList,
-    rangeDate,
-    commonModal,
-    detailModal
-  },
+  components: { STable, VSelect, allocationDetailModal, AllocateType, warehouse, dealerSearchList, rangeDate, commonModal, detailModal },
   data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      showDetailModal: false,
-      showTipModal: false,
-      bizSn: null,
-      tableHeight: 0,
-      allocateTypeVal: [],
+      showDetailModal: false, // 调拨单详情弹窗
+      showTipModal: false, // 发货单详情弹窗
+      bizSn: null, // 调拨单sn
+      tableHeight: 0, // 表格高度
+      allocateTypeVal: [], // 调拨类型
 
       // 查询参数
-      queryParam: { //  查询条件
+      queryParam: {
+        // 创建时间默认值
         time: [
           moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
           moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
         ],
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        beginDate: getDate.getThreeMonthDays().starttime, // 创建开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 创建结束时间
         targetName: '', //  调往对象
         costTypeSn: undefined, // 费用类型
         allocateSortSn: undefined, //  调拨类型1
         allocateTypeSn: undefined, //  调拨类型2
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
-        receiverSn: undefined,
-        checkStatus: undefined,
-        printState: undefined,
-        warehouseSn: undefined
+        receiverSn: undefined, // 收货客户sn
+        checkStatus: undefined, // 对单状态
+        printState: undefined, // 打印状态
+        warehouseSn: undefined// 出库仓库sn
       },
+      // 表单验证规则
       rules: {
-        'time': [{
-          required: true,
-          message: '请选择退货完成时间',
-          trigger: 'change'
-        }]
+        'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return queryOverviewPage(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
@@ -260,6 +246,7 @@ export default {
     }
   },
   computed: {
+    // 表头
     columns () {
       const _this = this
       const arr = [{
@@ -613,6 +600,7 @@ export default {
       this.$refs.receiverSn.resetForm()
       this.$refs.table.refresh(true)
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -620,12 +608,14 @@ export default {
       })
       _this.resetSearchForm()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200
     }
   },
   watch: {
+    // 展开关闭  监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 55 - 45
src/views/allocationManagement/matchSendOutOrder/list.vue

@@ -3,40 +3,40 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="matchSendOutOrderList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate ref="rangeDate" id="matchSendOutOrderList-time" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="调往对象">
-                <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
+                <a-input id="matchSendOutOrderList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="收货客户名称">
-                <dealerSearchList ref="receiverSn" @change="custChange" />
+                <dealerSearchList id="matchSendOutOrderList-receiverSn" ref="receiverSn" @change="custChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-show="isShowWarehouse">
+              <a-form-item label="调出仓库">
+                <warehouse
+                  v-model="queryParam.warehouseSn"
+                  isPermission
+                  id="matchSendOutOrderList-warehouseSn"
+                  placeholder="请选择调出仓库"
+                />
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="6" :sm="24" v-show="isShowWarehouse">
-                <a-form-item label="调出仓库">
-                  <warehouse
-                    v-model="queryParam.warehouseSn"
-                    isPermission
-                    id="allocateBillList-warehouseSn"
-                    placeholder="请选择调出仓库"
-                  />
-                </a-form-item>
-              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
                     v-model="queryParam.state"
                     ref="state"
-                    id="allocateBillList-state"
+                    id="matchSendOutOrderList-state"
                     code="ALLOCATE_STATUS"
                     placeholder="请选择业务状态"
                     allowClear
@@ -45,7 +45,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="调拨单号">
-                  <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+                  <a-input id="matchSendOutOrderList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -53,7 +53,7 @@
                   <v-select
                     v-model="queryParam.checkStatus"
                     ref="checkStatus"
-                    id="allocateBillList-checkStatus"
+                    id="matchSendOutOrderList-checkStatus"
                     code="CHECK_STATUS"
                     placeholder="请选择对单状态"
                     allowClear
@@ -62,19 +62,19 @@
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
                 <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                  <customerService ref="customerName" id="matchSendOutOrderList-bizUserSn" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-item>
               </a-col>
             </template>
             <a-col :md="isShowCustomerSearch?24:6" :sm="24" :style="{textAlign: isShowCustomerSearch?'center':''}">
-             <div class="table-page-search-submitButtons">
-               <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
-               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
-               <a @click="advanced=!advanced" style="margin-left: 5px">
-                 {{ advanced ? '收起' : '展开' }}
-                 <a-icon :type="advanced ? 'up' : 'down'"/>
-               </a>
-             </div>
+              <div class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="matchSendOutOrderList-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="matchSendOutOrderList-reset">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 5px" id="matchSendOutOrderList-advanced">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </div>
             </a-col>
           </a-row>
         </a-form>
@@ -97,7 +97,7 @@
           bordered>
           <!-- 单号 -->
           <template slot="allocateNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('M_transferOut_detail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
+            <span v-if="$hasPermissions('M_transferOut_detail')" :id="'matchSendOutOrderList-allocateNo'+record.id" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
             <span v-else>{{ record.allocateNo }}</span>
           </template>
           <!-- 操作 -->
@@ -108,7 +108,7 @@
               v-if="record.checkStatus == 'WAIT'&&$hasPermissions('B_YxAudit')"
               class="button-warning"
               @click="handleYxAudit(record)"
-              id="allocateBillList-checkStatus">对单通过</a-button>
+              :id="'matchSendOutOrderList-checkStatus'+record.id">对单通过</a-button>
             <span v-else>--</span>
           </template>
         </s-table>
@@ -131,6 +131,7 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import commonModal from '@/views/common/commonModal.vue'
@@ -138,43 +139,48 @@ import dealerSearchList from '@/views/common/dealerSearchList.vue'
 import customerService from '@/views/common/customerService.vue'
 import allocationDetailModal from '@/views/allocationManagement/transferOut/detail.vue'
 import warehouse from '@/views/common/chooseWarehouse.js'
+// 接口
 import { allocateBillList, allocateBillCheck } from '@/api/allocateBill'
 export default {
   name: 'MatchSendOutOrderAllocationList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, dealerSearchList, commonModal, allocationDetailModal, warehouse,customerService },
+  components: { STable, VSelect, rangeDate, dealerSearchList, commonModal, allocationDetailModal, warehouse, customerService },
   data () {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      // 创建时间 默认值
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
-      queryParam: { //  查询条件
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+      //  查询条件
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         targetName: '', //  调往对象
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
-        warehouseSn: undefined,
-        receiverSn: undefined,
-        checkStatus: undefined,
-        printState: undefined,
-        bizUserSn:undefined
+        warehouseSn: undefined, // 出库仓库
+        receiverSn: undefined, // 收货客户名称
+        checkStatus: undefined, // 对单状态
+        printState: undefined, // 打印状态
+        bizUserSn: undefined// 客服
       },
-      showDetailModal: false,
+      showDetailModal: false, // 详情弹窗
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
+      exportLoading: false, // 导出按钮加载状态
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return allocateBillList(Object.assign(parameter, this.queryParam, { authWarehouseFlag: 1 })).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
@@ -185,15 +191,14 @@ export default {
           return data
         })
       },
-      visibleAudit: false,
-      auditInfo: null,
-      bizSn: '',
-      spinningAudit: false,
+      bizSn: '', // 调拨sn
+      spinningAudit: false, // 审核按钮加载状态
       openModal: false //  新增编辑  弹框
-      
+
     }
   },
   computed: {
+    // 表头
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -218,6 +223,7 @@ export default {
     }
   },
   methods: {
+    // 收货客户名称 change
     custChange (val) {
       if (val.row) {
         this.queryParam.receiverSn = val.row.dealerSn
@@ -275,11 +281,13 @@ export default {
       this.bizSn = row.allocateSn
       this.showDetailModal = true
     },
+    // 关闭详情弹窗
     cancelDetail () {
       this.$store.state.app.curActionPermission = ''
       this.showDetailModal = false
       this.bizSn = null
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -287,12 +295,14 @@ export default {
       })
       this.openModal = false
     },
+    // 表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200
     }
   },
   watch: {
+    // 展开关闭  监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 5 - 5
src/views/allocationManagement/transferOut/basicInfoModal.vue

@@ -207,8 +207,8 @@ export default {
       })
     },
     departementChange (v, row) {
-       console.log(v,row)
-       this.form.targetName = row.name
+      console.log(v, row)
+      this.form.targetName = row.name
     },
     // 调拨类别 change
     allocateTypeChange (val, opt) {
@@ -257,9 +257,9 @@ export default {
       const ind = this.dealerData.findIndex(item => item.dealerSn == value)
       this.form.targetName = this.dealerData[ind].dealerName
       const wsn = this.dealerData[ind].defaultWarehouseSn
-      if(this.$refs.warehouse.hasWarehouse(wsn)){
+      if (this.$refs.warehouse.hasWarehouse(wsn)) {
         this.form.warehouseSn = wsn
-      }else{
+      } else {
         this.form.warehouseSn = undefined
       }
     },
@@ -349,7 +349,7 @@ export default {
         // 编辑
         if (this.detailData) {
           this.isEdit = true
-          this.form = Object.assign(this.form, this.detailData)
+          // this.form = Object.assign(this.form, this.detailData)
           // 获取附件列表
           this.form.attachmentList = ''
           this.attachList = this.detailData.attachmentList

+ 6 - 3
src/views/allocationManagement/transferOut/chooseImportModal.vue

@@ -68,6 +68,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { allocateBillParseProducts, allocateBillFailExcel } from '@/api/allocateBill'
 export default {
   name: 'TransferOutChooseImportModal',
@@ -104,15 +105,17 @@ export default {
         { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'errorDesc', width: 180, align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      loadData: [],
-      unLoadData: [],
-      loading: false
+      loadData: [], // 可导入数据
+      unLoadData: [], // 错误数据
+      loading: false// 表格加载状态
     }
   },
   methods: {
+    // 获取表格数据
     getData () {
       const _this = this
       this.loading = true
+      // 获取列表数据  无分页
       allocateBillParseProducts(this.paramsData).then(res => {
         this.loading = false
         if (res.status == 200) {

+ 20 - 9
src/views/allocationManagement/transferOut/detail.vue

@@ -14,7 +14,7 @@
             @click.stop="handleEdit">
             <a-icon type="edit"/>编辑
           </a-button>
-          <a-button type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button id="allocateBillDetail-showDetail-btn" type="link" class="button-default" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -25,7 +25,7 @@
             type="primary"
             class="button-info"
             v-if="$hasPermissions('B_transferOut_print')"
-            id="allocateBillDetail-db-print-btn"
+            id="allocateBillDetail-dbPrint-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbPrint')">调拨打印</a-button>
           <a-button
@@ -33,7 +33,7 @@
             type="primary"
             class="button-info"
             v-if="$hasPermissions('B_transferOutType_print')"
-            id="allocateBillDetail-dbfl-print-btn"
+            id="allocateBillDetail-dbflPrint-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbflPrint')">调拨分类打印</a-button>
           <a-divider type="vertical" />
@@ -50,7 +50,7 @@
             type="default"
             class="button-info"
             v-if="$hasPermissions('B_transferOutType_export')"
-            id="allocateBillDetail-export-btn"
+            id="allocateBillDetail-exportType-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbflExport')">调拨分类导出</a-button>
         </template>
@@ -96,6 +96,7 @@
                 <div v-if="basicInfoData&&basicInfoData.attachmentList&&basicInfoData.attachmentList.length">
                   <a
                     target="_blank"
+                    id="allocateBillDetail-attachmentList"
                     style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
                     :href="item.filePath"
                     v-for="item in basicInfoData.attachmentList"
@@ -149,6 +150,7 @@
                 <div v-if="basicInfoData&&basicInfoData.attachmentList&&basicInfoData.attachmentList.length">
                   <a
                     target="_blank"
+                    id="allocateBillDetail-attachmentList"
                     style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
                     :href="item.filePath"
                     v-for="item in basicInfoData.attachmentList"
@@ -202,9 +204,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import printModal from './printModal.vue'
 import { printBase64Fun, exportExcel } from '@/libs/JGPrint.js'
+// 接口
 import { allocateBillDetailList, allocateBillDetail, allocateBillDetailCount, allocateBillDetailPrint, allocateBillDetailExcel } from '@/api/allocateBill'
 export default {
   name: 'TransferOutDetail',
@@ -222,10 +226,12 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
+        // 获取列表数据  有分页
         return allocateBillDetailList(Object.assign(parameter, { allocateSn: this.outBizSn || this.$route.params.sn })).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
@@ -238,17 +244,19 @@ export default {
       },
       basicInfoData: null, //  基本信息
       productTotal: null, //  合计
-      localDataSource: [],
-      openModal: false,
-      nowType: null,
-      showDetail: false,
-      tableHeight: 0
+      localDataSource: [], // 表格数据
+      openModal: false, // 打印导出弹窗
+      nowType: null, // dbflExport 调拨分类 dbPrint调拨
+      showDetail: false, // 显示隐藏基础信息
+      tableHeight: 0// 计算表格高度
     }
   },
   computed: {
+    // 是否显示基础信息编辑按钮
     isEdit () {
       return this.basicInfoData && ((this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData.state == 'WAIT_AUDIT') || (this.basicInfoData.state == 'AUDIT_REJECT')) && this.$hasPermissions('M_transferOut_edit')
     },
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -278,6 +286,7 @@ export default {
     }
   },
   watch: {
+    // 基础信息显示关闭  表格高度变化
     showDetail (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -356,12 +365,14 @@ export default {
           printType: taskName + '打印'
         }, !this.basicInfoData.printState || this.basicInfoData.printState == 'UNABLE_PRINT' || this.basicInfoData.printState == 'CANCEL_PRINT')
     },
+    // 初始化
     pageInit () {
       this.$refs.table.refresh(true)
       this.getDetail()
       this.getDetailCount()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 280

+ 25 - 19
src/views/allocationManagement/transferOut/dsModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="dealerAccountEdit-modal"
+    class="transferOutDs-modal"
     :footer="null"
     :maskClosable="false"
     title="提交调拨单"
@@ -12,7 +12,7 @@
     <div>
       <a-spin :spinning="spinning" tip="Loading...">
         <a-form-model
-          id="dealerAccountEdit-form"
+          id="transferOutDs-form"
           ref="ruleForm"
           :model="form"
           :rules="rules"
@@ -20,11 +20,11 @@
           :wrapper-col="formItemLayout.wrapperCol"
         >
           <a-form-model-item label="收货客户名称" v-if="dealerLevel != 'OTHER'">
-            <dealerSubareaScopeList ref="custList" defValKey="buyerSn" @change="custChange" v-model="form.receiverSn" />
+            <dealerSubareaScopeList id="transferOutDs-custList" ref="custList" defValKey="buyerSn" @change="custChange" v-model="form.receiverSn" />
           </a-form-model-item>
           <a-form-model-item label="收货客户名称" v-else>
             <a-input
-              id="dealerAccountEdit-receiverName"
+              id="transferOutDs-receiverName"
               :maxLength="30"
               v-model.trim="form.receiverName"
               placeholder="请输入收货客户名称"
@@ -32,7 +32,7 @@
           </a-form-model-item>
           <a-form-model-item label="发货编号" prop="sendNo">
             <a-input
-              id="dealerAccountEdit-phone"
+              id="transferOutDs-sendNo"
               :maxLength="10"
               v-model.trim="form.sendNo"
               placeholder="请输入发货编号"
@@ -43,29 +43,29 @@
           </a-form-model-item>
           <a-form-model-item label="发货说明">
             <a-input
-              id="dealerAccountEdit-explainInfo"
+              id="transferOutDs-explainInfo"
               type="textarea"
               :maxLength="630"
               v-model.trim="form.explainInfo"
               placeholder="请输入发货说明"/>
           </a-form-model-item>
           <a-form-model-item label="备货打印" prop="printState">
-            <a-radio-group v-model="form.printState">
-              <a-radio value="NO_PRINT">
+            <a-radio-group id="transferOutDs-printState" v-model="form.printState">
+              <a-radio value="NO_PRINT" id="transferOutDs-printState1">
                 允许打印
               </a-radio>
-              <a-radio value="UNABLE_PRINT">
+              <a-radio value="UNABLE_PRINT" id="transferOutDs-printState2">
                 暂不打印
               </a-radio>
-              <a-radio value="CANCEL_PRINT">
+              <a-radio value="CANCEL_PRINT" id="transferOutDs-printState3">
                 取消打印
               </a-radio>
             </a-radio-group>
           </a-form-model-item>
         </a-form-model>
         <div class="btn-cont">
-          <a-button type="primary" id="dealerAccountEdit-save" @click="handleSave">确定</a-button>
-          <a-button id="dealerAccountEdit-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+          <a-button type="primary" id="transferOutDs-save" @click="handleSave">确定</a-button>
+          <a-button id="transferOutDs-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
         </div>
       </a-spin>
     </div>
@@ -74,9 +74,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 export default {
-  name: 'DealerAccountEditModal',
+  name: 'TransferOutDsModal',
   mixins: [commonMixin],
   components: { dealerSubareaScopeList },
   props: {
@@ -93,17 +94,20 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // form表单label布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      // 提交参数
       form: {
-        sendNo: '',
-        printState: '',
-        receiverSn: '',
-        receiverName: '',
-        explainInfo: ''
+        sendNo: '', // 发货编号
+        printState: '', // 备货打印状态
+        receiverSn: '', // 收货客户sn
+        receiverName: '', // 收货客户名称
+        explainInfo: ''// 发货说明
       },
+      // 表单验证规则
       rules: {
         sendNo: [{ required: true, message: '请输入发货编号', trigger: 'change' }],
         printState: [{ required: true, message: '请选择备货打印', trigger: 'change' }]
@@ -112,10 +116,12 @@ export default {
     }
   },
   methods: {
+    // 获取常用发货编号
     setSendNo (i) {
       this.form.sendNo = i
       this.$refs.ruleForm.validateField('sendNo')
     },
+    // 收货客户名称
     custChange (val) {
       this.form.receiverSn = val.key || ''
       this.form.receiverName = val.name || ''
@@ -171,7 +177,7 @@ export default {
 </script>
 
 <style lang="less">
-  .dealerAccountEdit-modal{
+  .transferOutDs-modal{
     .ant-modal-body {
       padding: 40px 40px 24px;
     }

+ 58 - 36
src/views/allocationManagement/transferOut/edit.vue

@@ -6,7 +6,7 @@
         <template slot="subTitle">
           <a id="allocateBillEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ basicInfoData&&basicInfoData.allocateNo }}</span>
-          <a-button type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button type="link" id="allocateBillEdit-showDetail" class="button-default" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -17,7 +17,7 @@
             type="primary"
             class="button-info"
             v-if="$hasPermissions('B_transferOut_print')"
-            id="allocateBillEdit-db-print-btn"
+            id="allocateBillEdit-dbPrint-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbPrint')">调拨打印</a-button>
           <a-button
@@ -25,7 +25,7 @@
             type="default"
             class="button-info"
             v-if="$hasPermissions('B_transferOutType_print')"
-            id="allocateBillEdit-dbfl-print-btn"
+            id="allocateBillEdit-dbflPrint-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbflPrint')">调拨分类打印</a-button>
           <a-divider type="vertical" />
@@ -42,7 +42,7 @@
             type="default"
             class="button-info"
             v-if="$hasPermissions('B_transferOutType_export')"
-            id="allocateBillDetail-export-btn"
+            id="allocateBillDetail-exportType-btn"
             :disabled="localDataSource.length==0"
             @click="handlePrint('dbflExport')">调拨分类导出</a-button>
         </template>
@@ -91,6 +91,7 @@
               <div v-if="basicInfoData&&basicInfoData.attachmentList&&basicInfoData.attachmentList.length">
                 <a
                   target="_blank"
+                  id="allocateBillDetail-attachmentList"
                   style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
                   :href="item.filePath"
                   v-for="item in basicInfoData.attachmentList"
@@ -107,7 +108,7 @@
       <a-card size="small" title="选择产品" :bordered="false" class="allocateBillEdit-cont">
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-form layout="inline" id="allocateBillDetail-form" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品编码" prop="productCode">
@@ -125,8 +126,8 @@
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
-                <a-button style="margin-left: 8px" @click="resetSearchForm(0)" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillEdit-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm(0)" :disabled="disabled" id="allocateBillEdit-reset">重置</a-button>
               </a-col>
             </a-row>
           </a-form>
@@ -138,7 +139,7 @@
           size="small"
           index="0"
           tableId="table1"
-          :rowKey="(record) => record.stockSn"
+          :rowKey="(record) => record.id"
           :columns="columns"
           :customRow="handleClickRow"
           :data="loadData"
@@ -158,6 +159,7 @@
             <div v-else>
               <span v-if="record.powerFlag!=0">{{ record.priceLevelDictValue }}</span>
               <v-select
+                :id="'allocateBillEdit-priceLevelDictValue'+record.id"
                 v-else
                 style="width:90%;"
                 size="small"
@@ -172,6 +174,7 @@
           <template slot="qty" slot-scope="text, record">
             <a-input-number
               size="small"
+              :id="'allocateBillEdit-qty'+record.id"
               v-model="record.qty"
               :precision="0"
               :min="1"
@@ -182,6 +185,7 @@
           <!-- 操作 -->
           <template slot="action1" slot-scope="text, record">
             <a-button
+              :id="'allocateBillEdit-add-btn'+record.id"
               size="small"
               type="link"
               class="button-primary"
@@ -205,21 +209,21 @@
         <a-row :gutter="15">
           <a-col :span="16">
             <div class="table-page-search-wrapper">
-              <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
+              <a-form id="allocateBillEdit-form-search" layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
                 <a-row :gutter="15">
                   <a-col :md="9" :sm="24">
                     <a-form-item label="产品编码" prop="productCode">
-                      <a-input id="allocateBillEdit-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                      <a-input id="allocateBillEdit-select-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="9" :sm="24">
                     <a-form-item label="产品名称" prop="productName">
-                      <a-input id="allocateBillEdit-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                      <a-input id="allocateBillEdit-select-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                    <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
-                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm(0)" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
+                    <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="allocateBillEdit-select-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm(0)" :disabled="chooseDisabled" id="allocateBillEdit-select-reset">重置</a-button>
                   </a-col>
                 </a-row>
               </a-form>
@@ -229,10 +233,10 @@
             <span v-if="selNums">已选{{ selNums }}项</span>
             <a-button
               style="margin:0 10px;"
-              id="salesEdit-plDel-btn"
+              id="allocateBillEdit-plDel-btn"
               @click="openPlSet">批量设置费用归属</a-button>
             <a-button id="allocateBillEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
-            <a-button type="danger" style="margin-left: 10px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
+            <a-button type="danger" style="margin-left: 10px" @click.stop="handleDel('', 'all')" id="allocateBillEdit-del-all-btn">整单删除</a-button>
           </a-col>
         </a-row>
         <!-- 列表 -->
@@ -258,7 +262,7 @@
             <div v-if="$route.params.dealerLevel == 'OTHER'">
               <a-select
                 size="small"
-                id="allocateBillEdit-price"
+                :id="'allocateBillEdit-select-price'+record.id"
                 option-label-prop="label"
                 v-model="record.price"
                 placeholder="请选择"
@@ -277,7 +281,7 @@
           <template slot="qty" slot-scope="text, record">
             <a-input-number
               size="small"
-              id="allocateBillEdit-qty"
+              :id="'allocateBillEdit-select-qty'+record.id"
               v-model="record.qty"
               :precision="0"
               :min="1"
@@ -291,6 +295,7 @@
             <a-select
               style="width:100%"
               placeholder="请选择部门"
+              :id="'allocateBillEdit-departmentSn'+record.id"
               size="small"
               allowClear
               v-model="record.departmentSn"
@@ -298,7 +303,7 @@
               @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-option :id="'allocateBillEdit-departmentSn'+item.departmentSn" v-for="item in departmentList" :key="item.departmentSn" :value="item.departmentSn">{{ item.name }}</a-select-option>
             </a-select>
           </template>
           <!-- 操作 -->
@@ -309,7 +314,7 @@
               class="button-error"
               :loading="spinning"
               @click="handleDel(record)"
-              id="allocateBillEdit-del-btn">删除</a-button>
+              :id="'allocateBillEdit-del-btn'+record.id">删除</a-button>
           </template>
         </s-table>
       </a-card>
@@ -363,6 +368,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import ImportGuideModal from './importGuideModal.vue'
 import basicInfoModal from './basicInfoModal.vue'
@@ -370,6 +376,7 @@ import printModal from './printModal.vue'
 import dsModal from './dsModal.vue'
 import commonModal from '@/views/common/commonModal.vue'
 import { printBase64Fun, exportExcel } from '@/libs/JGPrint.js'
+// 接口
 import { queryStockProductForOtherPage } from '@/api/stock'
 import { productPriceInfo } from '@/api/product'
 import { departmentQueryList } from '@/api/expenseManagement'
@@ -382,33 +389,37 @@ export default {
   data () {
     return {
       spinning: false,
-      showDsModal: false,
-      editRemark: false,
-      showPlModal: false,
+      showDsModal: false, // 提交调拨单弹窗
+      editRemark: false, // 编辑基础信息弹窗
+      showPlModal: false, // 批量设置部门弹窗
       showDetail: false, // 基础信息
+      // 查询条件
       queryParam: {
-        productCode: '',
-        productName: '',
-        productOrigCode: ''
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productOrigCode: ''// 原厂编码
       },
+      // 已选产品查询条件
       chooseQueryParam: {
-        productCode: '',
-        productName: ''
+        productCode: '', // 产品编码
+        productName: ''// 产品名称
       },
       disabled: false, //  查询、重置按钮是否可操作
-      loading: false,
+      loading: false, // 表格加载状态
       chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
       departmentList: [], // 部门列表
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        // 获取列表数据 有分页
         const dealerLevel = this.dealerLevel == 'OTHER' ? undefined : this.dealerLevel
         const warehouseSn = this.basicInfoData.warehouseSn
         const fun = this.dealerLevel == 'OTHER' ? queryStockProductForOtherPage : queryStockProductPage
         const dealerSnInfo = this.dealerLevel != 'OTHER' ? this.basicInfoData.dealerInfo.dealerSn : undefined
         return fun(Object.assign(parameter, this.queryParam, { zeroQtyFlag: '0', dealerLevel: dealerLevel, warehouseSn: warehouseSn, dealerSn: dealerSnInfo })).then(res => {
           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
@@ -420,14 +431,16 @@ export default {
           return data
         })
       },
-      loadDataSource: [],
-      localDataSource: [],
+      loadDataSource: [], // 调拨列表数据
+      localDataSource: [], // 调拨已选数据
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.chooseDisabled = true
+        // 获取已选列表数据  有分页
         const params = Object.assign(parameter, this.chooseQueryParam, { allocateSn: this.allocateSn })
         return allocateBillDetailList(params).then(res => {
           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
@@ -444,18 +457,20 @@ export default {
       productTotal: null, //  合计
       basicInfoData: null, // 基本信息
       openGuideModal: false, //  导入产品引导
-      openModal: false,
-      nowType: null,
-      rowSelectionInfo: null,
-      plSetVal: undefined,
-      dealerLevel: undefined,
-      allocateSn: undefined
+      openModal: false, // 打印预览/快捷打印弹窗
+      nowType: null, // 打印预览/快捷打印 类型
+      rowSelectionInfo: null, // 已选数据集合
+      plSetVal: undefined, // 部门sn
+      dealerLevel: undefined, // 经销商等级
+      allocateSn: undefined// 调拨sn
     }
   },
   computed: {
+    // 计算已选产品条数
     selNums () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -483,6 +498,7 @@ export default {
       }
       return arr
     },
+    // 已选列表表头
     chooseColumns () {
       const _this = this
       const arr = [
@@ -536,10 +552,12 @@ export default {
         this.$message.warning('请先选择产品!')
       }
     },
+    // 关闭批量设置费用归属部门弹窗
     closePlSet () {
       this.showPlModal = false
       this.plSetVal = undefined
     },
+    // 批量设置费用归属部门成功
     setPlSetOk () {
       if (!this.plSetVal) {
         this.$message.warning('请选择费用归属部门!')
@@ -700,6 +718,7 @@ export default {
         this.$message.warning('请选择产品')
       }
     },
+    // 提交
     handleSubmit (params) {
       const _this = this
       const data = Object.assign({ allocateSn: this.$route.params.sn }, params || {})
@@ -791,6 +810,7 @@ export default {
         _this.$store.state.app.curActionPermission = ''
       })
     },
+    // 打印导出
     exportFl (data) {
       this.handleExcel(data.printType, '调拨分类', data)
     },
@@ -799,6 +819,7 @@ export default {
       this.nowType = type
       this.openModal = true
     },
+    // 打印调拨分类、调拨 成功
     handleOk (objs) {
       const _this = this
       const params = JSON.parse(JSON.stringify(objs))
@@ -828,6 +849,7 @@ export default {
       this.$refs.chooseTable.clearSelected()
       this.$refs.chooseTable.refresh()
     },
+    // 初始化
     pageInit () {
       this.dealerLevel = this.$route.params.dealerLevel
       this.allocateSn = this.$route.params.sn

+ 14 - 5
src/views/allocationManagement/transferOut/importGuideModal.vue

@@ -19,7 +19,13 @@
             <li>2) 除了“产品编码”、“数量”两列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
+          <a-button
+            id="importGuide-download"
+            type="link"
+            icon="download"
+            style="padding: 0 0 0 23px;"
+            :loading="exportLoading"
+            @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -64,8 +70,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
+// 接口
 import { allocateBillDownload } from '@/api/allocateBill'
 export default {
   name: 'TransferOutImportGuideModal',
@@ -85,12 +93,12 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
-      paramsData: null,
-      uploadParams: {
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload', // 上传文件路径
+      paramsData: null, // 上传参数
+      uploadParams: { // 上传参数
         savePathType: 'local'
       },
-      exportLoading: false
+      exportLoading: false// 导出按钮加载状态
     }
   },
   methods: {
@@ -146,6 +154,7 @@ export default {
         }
       })
     },
+    // 下载模板
     download (data) {
       if (!data) { return }
       const url = window.URL.createObjectURL(new Blob([data]))

+ 55 - 44
src/views/allocationManagement/transferOut/list.vue

@@ -3,27 +3,27 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="transferOutList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate ref="rangeDate" id="transferOutList-time" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="调往对象">
-                <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
+                <a-input id="transferOutList-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-costTypeName" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
+                <AllocateType id="transferOutList-costTypeName" v-model="allocateTypeVal" :changeOnSelect="true" placeholder="请选择费用/调拨类型" @change="changeAllocatype"></AllocateType>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="收货客户名称">
-                  <dealerSearchList ref="receiverSn" @change="custChange" />
+                  <dealerSearchList id="transferOutList-receiverName" ref="receiverSn" @change="custChange" />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -31,7 +31,7 @@
                   <v-select
                     v-model="queryParam.state"
                     ref="state"
-                    id="allocateBillList-state"
+                    id="transferOutList-state"
                     code="ALLOCATE_STATUS"
                     placeholder="请选择业务状态"
                     allowClear
@@ -40,7 +40,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="调拨单号">
-                  <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+                  <a-input id="transferOutList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -48,7 +48,7 @@
                   <warehouse
                     isPermission
                     v-model="queryParam.warehouseSn"
-                    id="allocateBillList-warehouseSn"
+                    id="transferOutList-warehouseSn"
                     placeholder="请选择调出仓库"
                   />
                 </a-form-item>
@@ -58,7 +58,7 @@
                   <v-select
                     v-model="queryParam.printState"
                     ref="printState"
-                    id="allocateBillList-printState"
+                    id="transferOutList-printState"
                     code="PRINT_STATUS"
                     placeholder="请选择打印状态"
                     allowClear
@@ -70,7 +70,7 @@
                   <v-select
                     v-model="queryParam.checkStatus"
                     ref="checkStatus"
-                    id="allocateBillList-checkStatus"
+                    id="transferOutList-checkStatus"
                     code="CHECK_STATUS"
                     placeholder="请选择对单状态"
                     allowClear
@@ -79,13 +79,13 @@
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
                 <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                  <customerService id="transferOutList-bizUserSn" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="transferOutList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="transferOutList-reset">重置</a-button>
               <a-button
                 style="margin-left: 5px"
                 type="primary"
@@ -94,8 +94,8 @@
                 @click="handleExport"
                 :disabled="disabled"
                 :loading="exportLoading"
-                id="allocateBillList-export">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+                id="transferOutList-export">导出</a-button>
+              <a @click="advanced=!advanced" id="transferOutList-advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -108,7 +108,7 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator">
-          <a-button v-if="$hasPermissions('B_transferOut_add')" id="allocateBillList-add" type="primary" @click="openModal=true">新增</a-button>
+          <a-button v-if="$hasPermissions('B_transferOut_add')" id="transferOutList-add" type="primary" @click="openModal=true">新增</a-button>
         </div>
         <!-- 列表 -->
         <s-table
@@ -124,7 +124,7 @@
           bordered>
           <!-- 单号 -->
           <template slot="allocateNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('M_transferOut_detail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
+            <span v-if="$hasPermissions('M_transferOut_detail')" :id="'transferOutList-detail'+record.id" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
             <span v-else>{{ record.allocateNo }}</span>
           </template>
           <!-- 起止时间 -->
@@ -144,7 +144,7 @@
           <template slot="printStateWord" slot-scope="text, record">
             <span v-if="record.printState">
               <span v-if="record.printState=='NO_PRINT'||record.printState=='PRINT'">{{ record.printStateDictValue }}</span>
-              <span @click="handlePrint(record)" class="link-bule" v-else>{{ record.printStateDictValue }}</span>
+              <span :id="'transferOutList-print'+record.id" @click="handlePrint(record)" class="link-bule" v-else>{{ record.printStateDictValue }}</span>
             </span>
             <span v-else>--</span>
           </template>
@@ -156,28 +156,28 @@
             v-if="record.state == 'WAIT_AUDIT' && record.printState!='UNABLE_PRINT' && record.printState!='NO_PRINT' && $hasPermissions('B_tfo_yxPrint')"
             class="button-warning"
             @click="handleYxPrint(record)"
-            id="allocateBillList-examine-btn">允许打印</a-button> -->
+            id="transferOutList-examine-btn">允许打印</a-button> -->
             <a-button
               size="small"
               type="link"
               v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_transferOut_audit')"
               class="button-warning"
               @click="handleExamine(record)"
-              id="allocateBillList-examine-btn">审核</a-button>
+              :id="'transferOutList-audit-btn'+record.id">审核</a-button>
             <a-button
               size="small"
               type="link"
               v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'AUDIT_REJECT')) && $hasPermissions('M_transferOut_edit')"
               class="button-info"
               @click="handleEdit(record)"
-              id="allocateBillList-edit-btn">编辑</a-button>
+              :id="'transferOutList-edit-btn'+record.id">编辑</a-button>
             <a-button
               size="small"
               type="link"
               v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'WAIT_AUDIT') || (record.state == 'AUDIT_REJECT')) && $hasPermissions('B_transferOut_del')"
               class="button-error"
               @click="handleDel(record)"
-              id="allocateBillList-del-btn">删除</a-button>
+              :id="'transferOutList-del-btn'+record.id">删除</a-button>
             <span v-if="((record.state != 'WAIT_SUBMIT') && (record.state != 'WAIT_AUDIT') && (record.state != 'AUDIT_REJECT'))||(!$hasPermissions('B_transferOut_audit') && !$hasPermissions('M_transferOut_edit') && !$hasPermissions('B_transferOut_del'))">--</span>
           </template>
         </s-table>
@@ -202,6 +202,8 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -209,10 +211,10 @@ import auditModal from '@/views/common/auditModal.vue'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import customerService from '@/views/common/customerService'
 import dealerSearchList from '@/views/common/dealerSearchList.vue'
-import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport, allocateBillAblePrint } from '@/api/allocateBill'
 import AllocateType from '@/views/common/allocateType.js'
-import { hdExportExcel } from '@/libs/exportExcel'
 import printModal from './printStatusModal.vue'
+// 接口
+import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport, allocateBillAblePrint } from '@/api/allocateBill'
 export default {
   name: 'TransferOutList',
   mixins: [commonMixin],
@@ -221,38 +223,42 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      // 创建时间
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
-      allocateTypeVal: [],
-      queryParam: { //  查询条件
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+      allocateTypeVal: [], // 费用/调拨类型
+      //  查询条件
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime, // 开始创建时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束创建时间
         targetName: '', //  调往对象
         costTypeSn: undefined, // 费用类型
         allocateSortSn: undefined, //  调拨类型1
         allocateTypeSn: undefined, //  调拨类型2
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
-        receiverSn: undefined,
-        checkStatus: undefined,
-        printState: undefined,
-        warehouseSn: undefined,
-        bizUserSn: undefined
+        receiverSn: undefined, // 收货客户名称
+        checkStatus: undefined, // 对单状态
+        printState: undefined, // 打印状态
+        warehouseSn: undefined, // 出库仓库
+        bizUserSn: undefined // 客服
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      printIsShow: false,
+      printIsShow: false, // 打印弹窗
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return allocateBillList(Object.assign(parameter, this.queryParam, { authWarehouseFlag: 1 })).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
@@ -263,16 +269,15 @@ export default {
           return data
         })
       },
-      visibleAudit: false,
-      auditInfo: null,
-      spinningAudit: false,
+      visibleAudit: false, // 审核弹窗
+      auditInfo: null, // 审核当前行数据
+      spinningAudit: false, // 审核按钮加载状态
       openModal: false, //  新增编辑  弹框
-      printInfo: null
+      printInfo: null// 打印当前行信息
     }
   },
   computed: {
-    // dataIndex: 'printStateDictValue',
-    columns () {
+    columns () { // 表头
       const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '3.5%', align: 'center' },
@@ -311,6 +316,7 @@ export default {
       this.printIsShow = false
       this.$refs.table.refresh(true)
     },
+    // 收货客户名称
     custChange (val) {
       if (val.row) {
         this.queryParam.receiverSn = val.row.dealerSn
@@ -325,6 +331,7 @@ 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] : ''
@@ -398,7 +405,7 @@ export default {
         }
       })
     },
-    //  审核
+    //  打开审核弹窗
     handleExamine (row) {
       this.auditInfo = row
       this.visibleAudit = true
@@ -442,6 +449,7 @@ export default {
         _this.$store.state.app.curActionPermission = ''
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -449,10 +457,12 @@ export default {
       })
       this.openModal = false
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240
     },
+    // 打印
     handlePrint (item) {
       const obj = {
         no: item.allocateNo,
@@ -467,6 +477,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭  监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 31 - 23
src/views/allocationManagement/transferOut/printModal.vue

@@ -22,7 +22,7 @@
         <a-form-model-item style="margin-bottom: 0;" label="发货编号">{{ itemData&&itemData.sendNo || '--' }}</a-form-model-item>
         <a-form-model-item style="margin-bottom: 0;" label="收货客户名称">{{ itemData&&itemData.receiverName || '--' }}</a-form-model-item>
         <a-form-model-item style="margin-bottom: 0;" label="产品分类" prop="id" v-if="nowType=='dbflPrint'||nowType=='dbflExport'">
-          <a-select id="allocateBill-print-form" v-model="form.id" placeholder="请选择产品分类">
+          <a-select id="allocateBill-print-typeList" v-model="form.id" placeholder="请选择产品分类">
             <a-select-option v-for="item in typeList" :value="item.id" :key="item.id">
               <span v-if="item.id != 'all'">{{ item.productBrandName }} - {{ item.productTypeName3 }}</span>
               <span v-else>全部</span>
@@ -30,37 +30,37 @@
           </a-select>
         </a-form-model-item>
         <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 v-model="form.orderBy" id="allocateBill-print-orderBy">
+            <a-radio value="ASC" id="allocateBill-print-orderBy-asc">打印(↑升序)</a-radio>
+            <a-radio value="DESC" id="allocateBill-print-orderBy-desc">打印(↓降序)</a-radio>
+            <a-radio value="-1" id="allocateBill-print-orderBy-1">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="产品价格" style="margin-bottom: 0;" prop="priceType" v-if="nowType=='dbPrint'">
-          <a-radio-group v-model="form.priceType">
-            <a-radio value="ALLOCATE_BILL_PRICE" v-if="$hasPermissions('B_transferOut_print_salesPrice')">销售价</a-radio>
-            <a-radio value="ALLOCATE_BILL_COST" v-if="$hasPermissions('B_transferOut_print_costPrice')">成本价</a-radio>
-            <a-radio value="ALLOCATE_BILL">不打印</a-radio>
+          <a-radio-group v-model="form.priceType" id="allocateBill-print-priceType">
+            <a-radio value="ALLOCATE_BILL_PRICE" id="allocateBill-print-priceType1" v-if="$hasPermissions('B_transferOut_print_salesPrice')">销售价</a-radio>
+            <a-radio value="ALLOCATE_BILL_COST" id="allocateBill-print-priceType2" v-if="$hasPermissions('B_transferOut_print_costPrice')">成本价</a-radio>
+            <a-radio value="ALLOCATE_BILL" id="allocateBill-print-priceType3">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="产品价格" style="margin-bottom: 0;" prop="priceType" v-if="nowType=='dbExport'">
-          <a-radio-group v-model="form.priceType">
-            <a-radio value="ALLOCATE_BILL_PRICE" v-if="$hasPermissions('B_transferOut_detail_export_salesPrice')">销售价</a-radio>
-            <a-radio value="ALLOCATE_BILL_COST" v-if="$hasPermissions('B_transferOut_detail_export_costPrice')">成本价</a-radio>
-            <a-radio value="ALLOCATE_BILL">不导出</a-radio>
+          <a-radio-group v-model="form.priceType" id="allocateBill-print-priceType">
+            <a-radio value="ALLOCATE_BILL_PRICE" id="allocateBill-print-priceType1" v-if="$hasPermissions('B_transferOut_detail_export_salesPrice')">销售价</a-radio>
+            <a-radio value="ALLOCATE_BILL_COST" id="allocateBill-print-priceType2" v-if="$hasPermissions('B_transferOut_detail_export_costPrice')">成本价</a-radio>
+            <a-radio value="ALLOCATE_BILL" id="allocateBill-print-priceType3">不导出</a-radio>
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="备注" v-if="nowType=='dbPrint'">
-          <a-checkbox @change="onChangeRemark" :checked="remarkFlag">
+          <a-checkbox @change="onChangeRemark" :checked="remarkFlag" id="allocateBill-print-remark">
             打印
           </a-checkbox>
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button id="allocateBill-print-close" @click="handleClose('preview')">取消</a-button>
+        <a-button id="allocateBill-printcancel" @click="handleClose('preview')">取消</a-button>
         <a-button
           v-if="nowType=='dbflPrint'||nowType=='dbPrint'"
-          id="allocateBill-print-save"
+          id="allocateBill-print-dbflPrint"
           type="primary"
           class="button-info"
           @click="handleSave('preview')"
@@ -68,13 +68,13 @@
         <a-button
           v-if="hidePrint&&(nowType=='dbflPrint'||nowType=='dbPrint')"
           type="primary"
-          id="allocateBill-print-back"
+          id="allocateBill-print-dbflPrint"
           @click="handleSave('print')"
           style="margin-left: 15px;">确定打印</a-button>
         <a-button
           v-if="nowType=='dbflExport'||nowType=='dbExport'"
           type="primary"
-          id="allocateBill-print-back"
+          id="allocateBill-print-export"
           @click="handleSave('export')"
           style="margin-left: 15px;">确定导出</a-button>
       </div>
@@ -104,27 +104,32 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 提交参数
       form: {
-        id: 'all',
-        priceType: 'ALLOCATE_BILL',
-        orderBy: undefined,
+        id: 'all', // 产品分类
+        priceType: 'ALLOCATE_BILL', // 产品价格
+        orderBy: undefined, // 排序
         remarkFlag: 1// 备货打印  1打印 0不打印
       },
-      remarkFlag: true,
+      //
+      remarkFlag: true, // 备货打印
+      // 表单验证规则
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }],
         orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }]
       },
+      // form表单label布局
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
       spinning: false,
-      typeList: []
+      typeList: []// 产品分类列表数据
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       let title = ''
       if (this.nowType == 'dbPrint') {
@@ -138,11 +143,13 @@ export default {
       }
       return title
     },
+    // 打印状态
     hidePrint () {
       return this.itemData && this.itemData.printState && this.itemData.printState != 'UNABLE_PRINT' && this.itemData.printState != 'CANCEL_PRINT'
     }
   },
   methods: {
+    // 打印
     onChangeRemark (e) {
       this.remarkFlag = e.target.checked
       this.form.remarkFlag = e.target.checked ? 1 : 0
@@ -214,6 +221,7 @@ export default {
         }
       })
     },
+    // 关闭
     handleClose () {
       this.$emit('close')
       this.$refs.ruleForm.resetFields()

+ 20 - 15
src/views/allocationManagement/transferOut/printStatusModal.vue

@@ -9,7 +9,7 @@
     width="40%">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
-        id="chooseCustom-form"
+        id="printStatusModal-form"
         ref="ruleForm"
         :model="form"
         :rules="rules"
@@ -22,14 +22,14 @@
           <span>{{ form.targetName }}</span>
         </a-form-model-item>
         <a-form-model-item label="调拨打印:" prop="printStateInfo">
-          <a-radio-group v-model="form.printStateInfo">
-            <a-radio value="NO_PRINT">允许打印</a-radio>
-            <a-radio value="CANCEL_PRINT" v-if="form.printState == 'UNABLE_PRINT'">取消打印</a-radio>
+          <a-radio-group id="printStatusModal-printStateInfo" v-model="form.printStateInfo">
+            <a-radio value="NO_PRINT" id="printStatusModal-printStateInfo1">允许打印</a-radio>
+            <a-radio value="CANCEL_PRINT" v-if="form.printState == 'UNABLE_PRINT'" id="printStatusModal-printStateInfo0">取消打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 50px;">
-          <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
-          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
+          <a-button @click="cancel" style="margin-right: 15px" id="printStatusModal-cancel-btn">取消</a-button>
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="printStatusModal-submit-btn">确定</a-button>
         </a-form-model-item>
       </a-form-model>
     </a-spin>
@@ -37,6 +37,7 @@
 </template>
 
 <script>
+// 接口
 import { updatePrintState } from '@/api/allocateBill.js'
 export default {
   name: 'PrintModal',
@@ -51,11 +52,11 @@ export default {
   },
   data () {
     return {
-      opened: this.show,
+      opened: this.show, // 打开弹窗
       spinning: false,
-      title: '调拨打印状态',
-
-      confirmLoading: false,
+      title: '调拨打印状态', // 弹窗标题
+      confirmLoading: false, // 确定按钮加载状态
+      // form表单label布局
       formItemLayout: {
         labelCol: {
           span: 6
@@ -64,18 +65,20 @@ export default {
           span: 18
         }
       },
+      // 提交参数
       form: {
-        no: undefined,
+        no: undefined, //
         payerName: undefined,
-        printStatus: '',
-        allocateSn: '',
-        printStateInfo: ''
+        printStatus: '', // 打印状态
+        allocateSn: '', // 调拨单号
+        printStateInfo: ''// 调拨打印状态
       },
+      // 表单验证规则
       rules: { printStateInfo: [{ required: true, message: '请选择调拨打印状态', trigger: 'change' }] }
     }
   },
   methods: {
-    //  保存
+    // 确定保存验证
     handleSubmit () {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
@@ -86,6 +89,7 @@ export default {
         }
       })
     },
+    // 确定保存
     handleSave () {
       const _this = this
       const ajax_form = {
@@ -105,6 +109,7 @@ export default {
         _this.confirmLoading = false
       })
     },
+    // 关闭
     cancel () {
       this.opened = false
       this.$emit('cancel')

+ 49 - 29
src/views/allocationManagement/transferReturn/basicInfoModal.vue

@@ -1,16 +1,17 @@
 <template>
   <a-modal
     centered
-    class="allocateBill-basicInfo-modal"
+    class="transferReturn-basicInfo-modal"
     :footer="null"
     :maskClosable="false"
     title="新增调拨退货"
     v-model="isShow"
     @cancel="isShow = false"
     :width="800">
+    <!-- 搜索条件 -->
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
-        id="allocateBill-basicInfo-form"
+        id="transferReturn-basicInfo-form"
         ref="ruleForm"
         :model="form"
         :rules="rules"
@@ -21,7 +22,7 @@
           <v-select
             code="TARGET_TYPE"
             showType="radio"
-            id="allocateBill-basicInfo-targetType"
+            id="transferReturn-basicInfo-targetType"
             v-model="form.targetType"
             @change="targetTypeChange"
             allowClear
@@ -31,7 +32,7 @@
           <a-select
             v-if="isDealer"
             show-search
-            id="allocateBill-basicInfo-dealerName"
+            id="transferReturn-basicInfo-dealerName"
             v-model="form.targetSn"
             placeholder="请输入名称搜索经销商"
             :filter-option="false"
@@ -40,20 +41,32 @@
             @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-option v-for="item in dealerData" :id="'basicInfo-dealerName'+item.dealerSn" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
           </a-select>
-          <department v-else-if="isDepartment" style="width: 100%;" placeholder="请选择部门" @change="departementChange" v-model="form.targetSn"></department>
-          <a-input v-else v-model.trim="form.targetName" placeholder="请输入调拨退货对象名称(最多30个字符)" allowClear :maxLength="30" />
+          <department
+            v-else-if="isDepartment"
+            id="transferReturn-basicInfo-targetSn"
+            style="width: 100%;"
+            placeholder="请选择部门"
+            @change="departementChange"
+            v-model="form.targetSn"></department>
+          <a-input
+            id="transferReturn-basicInfo-targetName"
+            v-else
+            v-model.trim="form.targetName"
+            placeholder="请输入调拨退货对象名称(最多30个字符)"
+            allowClear
+            :maxLength="30" />
         </a-form-model-item>
         <a-form-model-item label="费用/调拨退货类型" prop="costTypeSn">
-          <AllocateType id="allocateBill-basicInfo-allocateTypeSn" v-model="allocateTypeVal" placeholder="请选择费用/调拨退货类型" @change="allocateTypeChange"></AllocateType>
+          <AllocateType id="transferReturn-basicInfo-allocateTypeVal" v-model="allocateTypeVal" placeholder="请选择费用/调拨退货类型" @change="allocateTypeChange"></AllocateType>
         </a-form-model-item>
         <a-form-model-item label="是否抓单" prop="grabFlag">
           <v-select
             code="FLAG"
             showType="radio"
             :disabled="form.targetType !== 'DEALER'"
-            id="allocateBill-basicInfo-grabFlag"
+            id="transferReturn-basicInfo-grabFlag"
             v-model="form.grabFlag"
             allowClear
             placeholder="请选择"></v-select>
@@ -61,17 +74,17 @@
         <a-form-model-item label="调入仓库" prop="warehouseSn">
           <warehouse
             v-model="form.warehouseSn"
-            id="allocateBill-basicInfo-warehouseSn"
+            id="transferReturn-basicInfo-warehouseSn"
             placeholder="请选择调入仓库"
           />
         </a-form-model-item>
         <a-form-model-item label="备注" prop="remark">
-          <a-textarea id="allocateBill-basicInfo-remark" :maxLength="120" v-model="form.remarks" placeholder="请输入备注(最多120个字符)" allowClear />
+          <a-textarea id="transferReturn-basicInfo-remark" :maxLength="120" v-model="form.remarks" placeholder="请输入备注(最多120个字符)" allowClear />
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button type="primary" id="allocateBill-basicInfo-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="allocateBill-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        <a-button type="primary" id="transferReturn-basicInfo-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="transferReturn-basicInfo-modal-cancel" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -80,12 +93,14 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import debounce from 'lodash/debounce'
+// 组件
 import { VSelect } from '@/components'
-import { allocateReturnSave, allocateReturnQueryBySn } from '@/api/allocateReturn'
 import department from '@/views/expenseManagement/expenseReimbursement/department.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
-import { dealerSubareaScopeList } from '@/api/dealer'
 import AllocateType from '@/views/common/allocateType.js'
+// 接口
+import { dealerSubareaScopeList } from '@/api/dealer'
+import { allocateReturnSave, allocateReturnQueryBySn } from '@/api/allocateReturn'
 export default {
   name: 'TransferOutBasicInfoModal',
   components: { VSelect, AllocateType, department, warehouse },
@@ -102,22 +117,25 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // form表单label布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 20 }
       },
-      allocateTypeVal: [],
+      allocateTypeVal: [], // 费用/调拨退货类型  下拉数据
+      // 提交参数
       form: {
-        targetType: 'DEALER',
-        targetSn: undefined,
-        targetName: '',
-        costTypeSn: undefined,
-        allocateSortSn: undefined,
-        allocateReturnTypeSn: undefined,
-        warehouseSn: undefined,
-        grabFlag: '1',
-        remarks: ''
+        targetType: 'DEALER', // 调往对象
+        targetSn: undefined, // 调往对象sn
+        targetName: '', // 调往对象名称
+        costTypeSn: undefined, // 费用/调拨退货类型sn
+        allocateSortSn: undefined, // 调拨对象sn
+        allocateReturnTypeSn: undefined, // 调拨类别sn
+        warehouseSn: undefined, // 出库仓库
+        grabFlag: '1', // 是否抓单 1是 0否
+        remarks: ''// 备注
       },
+      // 表单验证规则
       rules: {
         targetType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
         targetSn: [{ required: true, message: '请选择调往对象名称', trigger: 'change' }],
@@ -126,7 +144,7 @@ export default {
         grabFlag: [{ required: true, message: '请选择是否抓单', trigger: 'change' }],
         warehouseSn: [{ required: true, message: '请选择调入仓库', trigger: 'change' }]
       },
-      fetching: false,
+      fetching: false, // 经销商名称搜索 状态
       dealerData: [] //  经销商  下拉数据
     }
   },
@@ -160,9 +178,10 @@ export default {
       this.form.targetName = this.dealerData[ind].dealerName
       this.form.warehouseSn = this.dealerData[ind].defaultWarehouseSn
     },
+    // 选择部门
     departementChange (v, row) {
-       console.log(v,row)
-       this.form.targetName = row.name
+      console.log(v, row)
+      this.form.targetName = row.name
     },
     // 调拨类别 change
     allocateTypeChange (val, opt) {
@@ -221,6 +240,7 @@ export default {
       this.form.targetType = val
       this.form.grabFlag = val != 'DEALER' ? '0' : '1'
     },
+    // 重置
     resetForm () {
       this.$refs.ruleForm.resetFields()
       this.form = {
@@ -254,7 +274,7 @@ export default {
 </script>
 
 <style lang="less">
-.allocateBill-basicInfo-modal {
+.transferReturn-basicInfo-modal {
 	.ant-modal-body {
 		padding: 40px 40px 24px;
 	}

+ 37 - 29
src/views/allocationManagement/transferReturn/check.vue

@@ -1,17 +1,24 @@
 <template>
-  <div class="salesReturnCheck-wrap">
+  <div class="transferReturnCheck-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-      <a-page-header :ghost="false" :backIcon="false" class="salesReturnCheck-back" >
+      <a-page-header :ghost="false" :backIcon="false" class="transferReturnCheck-back" >
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
-          <a id="salesReturnCheck-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a id="transferReturnCheck-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;">调拨退货对象名称:{{ ordeDetail&&ordeDetail.targetName || '--' }} ({{ ordeDetail&&ordeDetail.grabFlag==1 ? '抓单' : '不抓单' }})</span>
         </template>
       </a-page-header>
       <a-card size="small" :bordered="false" class="salesReturnCheck-cont">
         <div>
-          <a-button type="primary" :loading="loading" class="button-info" @click="backStock('BATCH_BACK','批量返库')">批量返库</a-button>
-          <a-button v-if="grabFlag==1" type="default" :loading="loading" style="margin-right: 15px;" @click="backStock('BATCH_BAD','批量坏件')">批量坏件</a-button>
+          <!-- 操作按钮 -->
+          <a-button type="primary" id="transferReturnCheck-backStock" :loading="loading" class="button-info" @click="backStock('BATCH_BACK','批量返库')">批量返库</a-button>
+          <a-button
+            v-if="grabFlag==1"
+            id="transferReturnCheck-badStock"
+            type="default"
+            :loading="loading"
+            style="margin-right: 15px;"
+            @click="backStock('BATCH_BAD','批量坏件')">批量坏件</a-button>
           <span>已选 {{ rowSelectionInfo&&rowSelectionInfo.selectedRows.length }} 项</span>
         </div>
         <!-- 已选配件列表 -->
@@ -37,6 +44,7 @@
               v-model="record.backStockQty"
               :precision="0"
               :min="0"
+              :id="'transferReturnCheck-returnQty'+record.ids"
               :max="record.returnQty"
               placeholder="请输入"
               @blur="e => onCellBlur(e.target.value, record)"
@@ -54,55 +62,52 @@
         type="primary"
         class="button-primary"
         @click="handleSubmit()"
-        id="salesReturn-handleSubmit">提交</a-button>
+        id="transferReturnCheck-handleSubmit">提交</a-button>
     </div>
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
-import {
-  allocReturnDetailQueryPage,
-  allocateReturnQueryBySn,
-  allocateReturnCheckSubmit,
-  allocateReturnCheck
-} from '@/api/allocateReturn'
+import { allocReturnDetailQueryPage, allocateReturnQueryBySn, allocateReturnCheckSubmit, allocateReturnCheck } from '@/api/allocateReturn'
 export default {
   name: 'TransferReturnCheck',
   mixins: [commonMixin],
-  components: {
-    STable,
-    VSelect
-  },
+  components: { STable, VSelect },
   data () {
     return {
       spinning: false,
       tableHeight: 0, // 表格高度
-      orderSn: null,
-      grabFlag: null,
-      disabled: false,
+      orderSn: null, // 调拨退货sn
+      grabFlag: null, // 是否抓单 0否 1是
+      disabled: false, // 查询、重置按钮是否可操作
       isInster: false, // 是否正在添加产品
-      ordeDetail: { discountAmount: 0 },
-      loading: false,
-      // 已选产品
-      dataSource: [],
+      ordeDetail: {
+        discountAmount: 0 // 折扣金额
+      }, // 单据详细数据
+      loading: false, // 操作按钮加载状态
+      dataSource: [], // 已选产品
+      // 产品信息数据
       productForm: {
-        allocateReturnSn: ''
+        allocateReturnSn: '' // 调拨退货sn
       },
-      chooseLoadData: [],
+      chooseLoadData: [], // 已选列表数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // 查询总计
+        // 获取列表数据 有分页
         this.productForm.allocateReturnSn = this.$route.params.sn
         return allocReturnDetailQueryPage(Object.assign(parameter, this.productForm)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              // 重组列表数据名称
               data.list[i].ids = data.list[i].no + '-' + data.list[i].productSn
               data.list[i].badQty = (data.list[i].badQty || data.list[i].badQty == 0) ? data.list[i].badQty : data.list[i].returnQty
               data.list[i].backStockQty = data.list[i].backStockQty || 0
@@ -114,10 +119,11 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null
+      rowSelectionInfo: null// 已选数据
     }
   },
   computed: {
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -133,8 +139,8 @@ export default {
       if (this.grabFlag == 1) { //  抓单
         arr.splice(1, 0, { title: '调拨单号', dataIndex: 'allocateNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } })
       }
-      if(this.$hasPermissions('M_transferReturnCheck_salesPrice')){
-        arr.splice(this.grabFlag == 1?8:7,0,{ title: '退货单价', dataIndex: 'price', align: 'right', width: '10%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      if (this.$hasPermissions('M_transferReturnCheck_salesPrice')) {
+        arr.splice(this.grabFlag == 1 ? 8 : 7, 0, { title: '退货单价', dataIndex: 'price', align: 'right', width: '10%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }
@@ -233,6 +239,7 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -243,6 +250,7 @@ export default {
       this.$refs.table.clearTable()
       this.getOrderDetail()
     },
+    // 计算表格高度
     setTableH () {
       this.tableHeight = window.innerHeight - 340
     }

+ 5 - 3
src/views/allocationManagement/transferReturn/chooseImportModal.vue

@@ -68,6 +68,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { allocateBillParseProducts, allocateBillFailExcel } from '@/api/allocateBill'
 export default {
   name: 'TransferReturnImportModal',
@@ -104,12 +105,13 @@ export default {
         { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'errorDesc', width: 180, align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      loadData: [],
-      unLoadData: [],
-      loading: false
+      loadData: [], // 可导入数据
+      unLoadData: [], // 导入错误数据
+      loading: false// 表格加载状态
     }
   },
   methods: {
+    // 获取导入数据
     getData () {
       const _this = this
       this.loading = true

+ 15 - 7
src/views/allocationManagement/transferReturn/detail.vue

@@ -96,8 +96,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import print from './print.vue'
+// 接口
 import { allocReturnDetailQueryPage, allocateReturnQueryBySn } from '@/api/allocateReturn'
 export default {
   name: 'TransferReturnDetail',
@@ -108,11 +110,11 @@ export default {
       type: [Number, String],
       default: ''
     },
-    showPrice: {
+    showPrice: {// 是否显示价格
       type: Boolean,
       default: false
     },
-    pageType: {
+    pageType: {// 页面类型
       type: String,
       default: 'pages'
     }
@@ -123,10 +125,12 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
+        // 获取列表数据 有分页
         return allocReturnDetailQueryPage(Object.assign(parameter, { allocateReturnSn: this.outBizSn || this.$route.params.sn })).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
@@ -138,17 +142,17 @@ export default {
         })
       },
       basicInfoData: null, //  基本信息
-      localDataSource: [],
-      openModal: false,
-      nowType: null,
-      showDetail: true,
-      tableHeight: 0
+      localDataSource: [], // 表格数据
+      showDetail: true, // 显示隐藏基础信息
+      tableHeight: 0// 表格高度
     }
   },
   computed: {
+    // 是否可编辑基础信息
     isEdit () {
       return this.basicInfoData && ((this.basicInfoData.state == 'WAIT_SUBMIT') || (this.basicInfoData.state == 'FINANCIAL_REJECT') || (this.basicInfoData.state == 'AUDIT_REJECT')) && this.$hasPermissions('B_transferReturnEdit')
     },
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -173,6 +177,7 @@ export default {
     }
   },
   watch: {
+    // 显示隐藏基础信息  监听表格高度变化
     showDetail (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -182,6 +187,7 @@ export default {
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
       this.setTableH()
     },
+    // 根据页面类型计算表格高度
     outBizSn (newValue, oldValue) {
       if (newValue) {
         this.pageInit()
@@ -208,6 +214,7 @@ export default {
       const row = this.basicInfoData
       this.$router.push({ name: row.grabFlag == 1 ? 'transferReturnGrpEdit' : 'transferReturnEdit', params: { sn: row.allocateReturnSn, targetType: row.targetType, dealerLevel: row.dealerLevel } })
     },
+    // 初始化
     pageInit () {
       if (this.outBizSn || this.$route.params.sn) {
         this.$refs.table.refresh(true)
@@ -215,6 +222,7 @@ export default {
         this.setTableH()
       }
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 285

+ 52 - 38
src/views/allocationManagement/transferReturn/edit.vue

@@ -1,13 +1,13 @@
 <template>
-  <div class="allocateBillEdit-wrap">
+  <div class="transferReturnEdit-wrap">
     <!-- <a-spin :spinning="spinning" tip="Loading..."> -->
     <div class="ant-spin-nested-loading">
-      <a-page-header :ghost="false" :backIcon="false" class="allocateBillEdit-back" >
+      <a-page-header :ghost="false" :backIcon="false" class="transferReturnEdit-back" >
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
-          <a id="allocateBillEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <a id="transferReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ basicInfoData&&basicInfoData.allocateReturnNo }}</span>
-          <a-button type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button id="transferReturnEdit-showDetail" type="link" class="button-default" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -16,7 +16,7 @@
           <print :params="{allocateReturnSn: allocateReturnSn}" :basicInfoData="basicInfoData" :disabled="localDataSource.length==0" @loading="spinning=true" @unloading="spinning=false"></print>
         </template>
       </a-page-header>
-      <a-card size="small" :bordered="false" v-if="basicInfoData" class="allocateBillEdit-cont" v-show="showDetail">
+      <a-card size="small" :bordered="false" v-if="basicInfoData" class="transferReturnEdit-cont" v-show="showDetail">
         <a-descriptions :column="3">
           <a-descriptions-item label="调拨退货单号">{{ (basicInfoData&&basicInfoData.allocateReturnNo) || '--' }}</a-descriptions-item>
           <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetTypeDictValue) || '--' }}</a-descriptions-item>
@@ -34,7 +34,7 @@
           </a-descriptions-item>
           <a-descriptions-item label="费用/调拨退货类型">
             <AllocateType
-              id="allocateEdit-allocateReturnTypeSn"
+              id="transferReturnEdit-allocateTypeVal"
               style="width: 220px;"
               v-model="allocateTypeVal"
               :allowClear="false"
@@ -50,24 +50,24 @@
         </a-descriptions>
       </a-card>
       <!-- 选择产品 -->
-      <a-card size="small" title="选择产品" :bordered="false" class="allocateBillEdit-cont">
+      <a-card size="small" title="选择产品" :bordered="false" class="transferReturnEdit-cont">
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-form layout="inline" id="transferReturnEdit-form" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品编码" prop="productCode">
-                  <a-input id="allocateBillEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+                  <a-input id="transferReturnEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品名称" prop="productName">
-                  <a-input id="allocateBillEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+                  <a-input id="transferReturnEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
-                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="transferReturnEdit-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="transferReturnEdit-reset">重置</a-button>
               </a-col>
             </a-row>
           </a-form>
@@ -80,6 +80,7 @@
           index="0"
           tableId="table1"
           :rowKey="(record) => record.stockSn"
+          rowKeyName="stockSn"
           :columns="columns"
           :customRow="handleClickRow"
           :data="loadData"
@@ -97,6 +98,7 @@
               v-model="record.priceLevel"
               allowClear
               placeholder="请选择价格级别"
+              :id="'transferReturnEdit-priceLevel'+record.stockSn"
               @change="e => handlePriceLevel(e,index)"></v-select>
           </template>
           <!-- 退货单价 -->
@@ -113,6 +115,7 @@
                 :min="1"
                 :max="99999999"
                 placeholder="请输入"
+                :id="'transferReturnEdit-qty'+record.stockSn"
                 style="width: 100%;" />
             </div>
           </template>
@@ -124,13 +127,13 @@
               v-if="record.lastStockCost"
               class="button-primary"
               @click="handleAdd(record)"
-              id="allocateBillEdit-add-btn">添加</a-button>
+              :id="'transferReturnEdit-add-btn'+record.stockSn">添加</a-button>
             <span v-else>--</span>
           </template>
         </s-table>
       </a-card>
       <!-- 已选产品 -->
-      <a-card size="small" title="已选产品" :bordered="false" class="allocateBillEdit-cont">
+      <a-card size="small" title="已选产品" :bordered="false" class="transferReturnEdit-cont">
         <!-- 总计 -->
         <a-alert type="info" style="margin-bottom:10px">
           <div slot="message">
@@ -155,8 +158,8 @@
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                    <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
-                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
+                    <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="editGrap-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="editGrap-reset">重置</a-button>
                   </a-col>
                 </a-row>
               </a-form>
@@ -185,6 +188,7 @@
             <a-input-number
               size="small"
               v-model="record.returnQty"
+              :id="'editGrap-returnQty'+record.id"
               :precision="0"
               :min="1"
               :max="99999999"
@@ -194,7 +198,7 @@
           </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" @click="handleDel(record)" :id="'transferReturnEdit-del-btn'+record.id">删除</a-button>
           </template>
         </s-table>
       </a-card>
@@ -203,7 +207,7 @@
     <div class="affix-cont">
       <a-button
         type="primary"
-        id="allocateBillEdit-submit"
+        id="transferReturnEdit-submit"
         size="large"
         :disabled="spinning"
         class="button-primary"
@@ -224,14 +228,15 @@
       @cancel="editRemark = false"
       :width="600">
       <a-textarea
+        id="transferReturnEdit-remarks"
         v-model="basicInfoData.remarks"
         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>
+        <a-button type="primary" id="transferReturnEdit-save" @click="handleEditRemark">保存</a-button>
+        <a-button id="transferReturnEdit-cancel" @click="editRemark = false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-modal>
   </div>
@@ -239,11 +244,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 // import ImportGuideModal from './importGuideModal.vue'
 import print from './print.vue'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import AllocateType from '@/views/common/allocateType.js'
+// 接口
 import {
   allocateReturnSave,
   allocReturnDetailQueryPage,
@@ -264,21 +271,23 @@ export default {
     const _this = this
     return {
       spinning: false,
+      // 查询条件
       queryParam: {
-        productCode: '',
-        productName: '',
-        productOrigCode: ''
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productOrigCode: ''// 原厂编码
       },
+      // 已选列表查询条件
       chooseQueryParam: {
-        productCode: '',
-        productName: ''
+        productCode: '', // 产品编码
+        productName: '' // 产品名称
       },
-      editRemark: false,
+      editRemark: false, // 编辑备注
       disabled: false, //  查询、重置按钮是否可操作
-      loading: false,
+      loading: false, // 加载状态
       chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
-      dealerLevel: '',
+      dealerLevel: '', // 经销商等级
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -286,8 +295,10 @@ export default {
         const dealerLevel = _this.dealerLevel == 'OTHER' ? undefined : _this.dealerLevel
         const dealerSnInfo = _this.dealerLevel != 'OTHER' ? _this.basicInfoData.dealerEntity.dealerSn : undefined
         const ajaxName = _this.basicInfoData.targetType === 'DEALER' ? queryStockProductPage : stockQueryStockProductPage
+        // 获取列表数据  有分页
         return ajaxName(Object.assign(parameter, this.queryParam, { dealerLevel: dealerLevel === '0' ? '' : dealerLevel, warehouseSn: warehouseSn, dealerSn: dealerSnInfo })).then(res => {
           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
@@ -303,15 +314,17 @@ export default {
           return data
         })
       },
-      loadDataSource: [],
-      localDataSource: [],
-      allocateReturnSn: '',
+      loadDataSource: [], // 列表数据
+      localDataSource: [], // 已选列表数据
+      allocateReturnSn: '', // 调拨退货sn
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.chooseDisabled = true
+        // 获取已选列表数据  有分页
         const params = Object.assign(parameter, { product: { name: this.chooseQueryParam.productName, code: this.chooseQueryParam.productCode }, allocateReturnSn: this.allocateReturnSn })
         return allocReturnDetailQueryPage(params).then(res => {
           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
@@ -325,13 +338,12 @@ export default {
       },
       basicInfoData: null, // 基本信息
       openGuideModal: false, //  导入产品引导
-      openModal: false,
-      nowType: null,
-      allocateTypeVal: [],
-      showDetail: false
+      allocateTypeVal: [], // 费用/调拨退货类型 列表数据
+      showDetail: false// 显示隐藏基础信息
     }
   },
   computed: {
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -349,6 +361,7 @@ export default {
       }
       return arr
     },
+    // 已选数据表头
     chooseColumns () {
       const _this = this
       const arr = [
@@ -582,6 +595,7 @@ export default {
       this.getDetail(true)
       this.$refs.chooseTable.refresh()
     },
+    // 初始化
     pageInit () {
       this.allocateReturnSn = this.$route.params.sn
       this.refashPage()
@@ -605,7 +619,7 @@ export default {
 </script>
 
 <style lang="less">
-  .allocateBillEdit-wrap{
+  .transferReturnEdit-wrap{
     position: relative;
     height: 100%;
     box-sizing: border-box;
@@ -614,13 +628,13 @@ export default {
       height: 100%;
       padding-bottom: 51px;
     }
-    .allocateBillEdit-back{
+    .transferReturnEdit-back{
       margin-bottom: 6px;
       .ant-page-header-heading-sub-title{
         margin:0;
       }
     }
-    .allocateBillEdit-cont{
+    .transferReturnEdit-cont{
       margin-bottom: 6px;
       .sub-title{
         font-size: 12px;

+ 45 - 40
src/views/allocationManagement/transferReturn/editGrp.vue

@@ -7,7 +7,7 @@
         <template slot="subTitle">
           <a id="editGrap-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ basicInfoData&&basicInfoData.allocateReturnNo }}</span>
-          <a-button type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button type="link" id="editGrap-showDetail" class="button-default" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -35,7 +35,7 @@
             </a-descriptions-item>
             <a-descriptions-item label="费用/调拨退货类型">
               <AllocateType
-                id="allocateEdit-allocateReturnTypeSn"
+                id="editGrap-allocateTypeVal"
                 style="width: 220px;"
                 v-model="allocateTypeVal"
                 placeholder="请选择费用/调拨退货类型"
@@ -58,7 +58,7 @@
             <a-button
               type="primary"
               class="button-info"
-              id="salesEdit-plDel-btn"
+              id="editGrap-plAdd"
               @click="handleBatchAdd">批量添加</a-button>
             <span>已选{{ selectTotal }}项</span>
           </div>
@@ -80,8 +80,8 @@
                 </a-form-item>
               </a-col>
               <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
-                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
-                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="editGrap-refresh">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="editGrap-reset">重置</a-button>
               </a-col>
             </a-row>
           </a-form>
@@ -116,13 +116,14 @@
                 </div>
               </template> -->
           <!-- 本次可退数量 -->
-          <template slot="returnNumber" slot-scope="text, record,index">
+          <template slot="returnNumber" slot-scope="text, record">
             <a-input-number
               v-if="record.refundableQty!=0"
               size="small"
               v-model="record.returnableQty"
               :precision="0"
               :min="0"
+              :id="'editGrap-refundableQty-'+record.allocateNo +'-'+ record.productSn"
               :max="record.refundableQty"
               placeholder="请输入"
               style="width: 100%;" />
@@ -135,8 +136,8 @@
               v-if="record.refundableQty"
               type="link"
               class="button-primary"
-              @click="handleAdd(record)"
-              id="editGrap-add-btn">添加</a-button>
+              :id="'editGrap-add-btn-'+record.allocateNo +'-'+ record.productSn"
+              @click="handleAdd(record)">添加</a-button>
             <span v-else>--</span>
           </template>
         </s-table>
@@ -158,17 +159,17 @@
                 <a-row :gutter="15">
                   <a-col :md="9" :sm="24">
                     <a-form-item label="产品编码" prop="productCode">
-                      <a-input id="editGrap-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
+                      <a-input id="editGrap-choosed-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="9" :sm="24">
                     <a-form-item label="产品名称" prop="productName">
-                      <a-input id="editGrap-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
+                      <a-input id="editGrap-choosed-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
                     </a-form-item>
                   </a-col>
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                    <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="storeTransferOutList-refresh">查询</a-button>
-                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="storeTransferOutList-reset">重置</a-button>
+                    <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="editGrap-choosed-refresh">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="editGrap-choosed-reset">重置</a-button>
                   </a-col>
                 </a-row>
               </a-form>
@@ -228,7 +229,7 @@
     <!-- 修改基础信息 -->
     <a-modal
       centered
-      wrapClassName="allocateBill-editRemark-modal"
+      wrapClassName="transferReturn-editRemark-modal"
       v-if="basicInfoData"
       :footer="null"
       :maskClosable="false"
@@ -243,8 +244,8 @@
         :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>
+        <a-button type="primary" id="transferReturn-editGrp-modal-save" @click="handleEditRemark">保存</a-button>
+        <a-button id="transferReturn-editGrp-modal-cancel" @click="editRemark = false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-modal>
   </div>
@@ -252,22 +253,15 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+//组件
 import { STable, VSelect } from '@/components'
 // import ImportGuideModal from './importGuideModal.vue'
 import print from './print.vue'
 import warehouse from '@/views/common/chooseWarehouse.js'
-import { allocDetailQueryPageForReturn } from '@/api/allocateBill'
 import AllocateType from '@/views/common/allocateType.js'
-import {
-  allocateReturnSave,
-  allocReturnDetailQueryPage,
-  allocateReturnQueryBySn,
-  allocReturnDetailInsert,
-  allocReturnDetailUpdate,
-  allocateReturnSubmit,
-  allocReturnDetailDelete,
-  allocReturnDetailInsertBatch
-} from '@/api/allocateReturn'
+//接口
+import { allocDetailQueryPageForReturn } from '@/api/allocateBill'
+import {allocateReturnSave, allocReturnDetailQueryPage, allocateReturnQueryBySn,allocReturnDetailInsert,allocReturnDetailUpdate,allocateReturnSubmit, allocReturnDetailDelete,allocReturnDetailInsertBatch} from '@/api/allocateReturn'
 
 export default {
   name: 'TransferReturnGrpEdit',
@@ -276,30 +270,34 @@ export default {
   data () {
     return {
       spinning: false,
-      showDetail: false,
+      showDetail: false,//控制基础信息显示
+      // 查询条件
       queryParam: {
-        productCode: '',
-        productName: '',
-        allocateNo: ''
+        productCode: '',//产品编码
+        productName: '',//产品名称
+        allocateNo: ''//调拨单号
       },
+      //已选产品查询条件
       chooseQueryParam: {
-        productCode: '',
-        productName: ''
+        productCode: '',//产品编码
+        productName: ''//产品名称
       },
-      editRemark: false,
+      editRemark: false,//编辑备注
       disabled: false, //  查询、重置按钮是否可操作
-      loading: false,
+      loading: false,//表格加载状态
       chooseDisabled: false, //  查询、重置按钮是否可操作
       advanced: false, // 高级搜索 展开/关闭
-      allocateReturnSn: '',
+      allocateReturnSn: '',//调拨sn
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         const targetSn = this.basicInfoData.targetSn
         const allocateNo = this.queryParam.allocateNo
+        //获取待选产品列表  有分页
         const otherParams = { allocateBill: { targetType: this.basicInfoData.targetType, targetSn: targetSn, allocateNo: allocateNo } }
         return allocDetailQueryPageForReturn(Object.assign(parameter, this.queryParam, otherParams)).then(res => {
           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
@@ -312,14 +310,16 @@ export default {
           return data
         })
       },
-      loadDataSource: [],
-      localDataSource: [],
+      loadDataSource: [],//待选表格数据
+      localDataSource: [],//已选表格数据
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.chooseDisabled = true
+        //获取已选表格数据  有分页
         const params = Object.assign(parameter, { product: { name: this.chooseQueryParam.productName, code: this.chooseQueryParam.productCode }, allocateReturnSn: this.allocateReturnSn })
         return allocReturnDetailQueryPage(params).then(res => {
           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
@@ -332,14 +332,16 @@ export default {
       },
       basicInfoData: null, // 基本信息
       openGuideModal: false, //  导入产品引导
-      rowSelectionInfo: null,
-      allocateTypeVal: []
+      rowSelectionInfo: null,//已选表格数据
+      allocateTypeVal: []//调拨退货类型列表
     }
   },
   computed: {
+    //计算所选条数
     selectTotal () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
+    //表头
     columns () {
       const _this = this
       const arr = [
@@ -358,6 +360,7 @@ export default {
       arr.splice(5, 0, { title: '调拨单价', dataIndex: 'price', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       return arr
     },
+    //已选列表表头
     chooseColumns () {
       const _this = this
       const arr = [
@@ -420,6 +423,7 @@ export default {
         }
       })
     },
+    //添加成功后的操作提示
     showFailMessage (data) {
       const h = this.$createElement
       const htmlStr = [h('p', data.message)]
@@ -634,6 +638,7 @@ export default {
       this.$refs.table.refresh()
       this.$refs.chooseTable.refresh()
     },
+    //初始化
     pageInit () {
       this.allocateReturnSn = this.$route.params.sn
       this.getDetail()
@@ -695,7 +700,7 @@ export default {
       }
     }
   }
-  .allocateBill-editRemark-modal{
+  .transferReturn-editRemark-modal{
     .btn-cont{
       text-align: center;
       padding-top: 20px;

+ 14 - 5
src/views/allocationManagement/transferReturn/importGuideModal.vue

@@ -19,7 +19,13 @@
             <li>2) 除了“产品编码”、“数量”两列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
+          <a-button
+            id="importGuide-download"
+            type="link"
+            icon="download"
+            style="padding: 0 0 0 23px;"
+            :loading="exportLoading"
+            @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -64,8 +70,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
+// 接口
 import { allocateBillDownload } from '@/api/allocateBill'
 export default {
   name: 'TransferReturnImportGuideModal',
@@ -85,12 +93,12 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
-      paramsData: null,
-      uploadParams: {
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload', // 上传文件地址
+      paramsData: null, // 上传文件参数
+      uploadParams: {// 上传文件参数
         savePathType: 'local'
       },
-      exportLoading: false
+      exportLoading: false// 导出按钮加载状态
     }
   },
   methods: {
@@ -146,6 +154,7 @@ export default {
         }
       })
     },
+    // 下载模板
     download (data) {
       if (!data) { return }
       const url = window.URL.createObjectURL(new Blob([data]))

+ 34 - 24
src/views/allocationManagement/transferReturn/list.vue

@@ -3,11 +3,11 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="transferReturn-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate ref="rangeDate" id="transferReturn-time" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -49,7 +49,7 @@
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
                 <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                  <customerService id="transferReturn-bizUserSn" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-item>
               </a-col>
             </template>
@@ -65,7 +65,7 @@
               :disabled="disabled"
               :loading="exportLoading"
               id="transferReturn-export">导出</a-button> -->
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="transferReturn-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -95,7 +95,7 @@
           bordered>
           <!-- 单号 -->
           <template slot="allocateReturnNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('M_transferReturnDetail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateReturnNo }}</span>
+            <span v-if="$hasPermissions('M_transferReturnDetail')" :id="'transferReturn-allocateReturnNo'+record.id" class="link-bule" @click="handleDetail(record)">{{ record.allocateReturnNo }}</span>
             <span v-else>{{ record.allocateReturnNo }}</span>
           </template>
           <!-- 调拨类型 -->
@@ -114,28 +114,28 @@
               v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_transferReturnAudit')"
               class="button-warning"
               @click="handleExamine(record)"
-              id="transferReturn-examine-btn">审核</a-button>
+              :id="'transferReturn-audit-btn'+record.id">审核</a-button>
             <a-button
               size="small"
               type="link"
               class="button-warning"
               v-if="record.state=='WAIT_CHECK' && $hasPermissions('M_transferReturnCheck')"
               @click="handleCheck(record)"
-              id="transferReturn-examine-btn">品检</a-button>
+              :id="'transferReturn-check-btn'+record.id">品检</a-button>
             <a-button
               size="small"
               type="link"
               v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'FINANCIAL_REJECT') || (record.state == 'AUDIT_REJECT')) && $hasPermissions('B_transferReturnEdit')"
               class="button-info"
               @click="handleEdit(record)"
-              id="transferReturn-edit-btn">编辑</a-button>
+              :id="'transferReturn-edit-btn'+record.id">编辑</a-button>
             <a-button
               size="small"
               type="link"
               v-if="((record.state == 'WAIT_SUBMIT') || (record.state == 'FINANCIAL_REJECT') || (record.state == 'AUDIT_REJECT')) && $hasPermissions('B_transferReturnDel')"
               class="button-error"
               @click="handleDel(record)"
-              id="transferReturn-del-btn">删除</a-button>
+              :id="'transferReturn-del-btn'+record.id">删除</a-button>
             <!-- 带财务确认或已完结 -->
             <span v-if="record.state == 'WAIT_FINANCIAL_AUDIT'||record.state == 'FINISH'">--</span>
           </template>
@@ -157,15 +157,17 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 import auditModal from '@/views/common/auditModal.vue'
-import { allocateReturnQueryPage, allocateReturnAudit, allocateReturnDelete } from '@/api/allocateReturn'
 import AllocateType from '@/views/common/allocateType.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import customerService from '@/views/common/customerService'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
+import { allocateReturnQueryPage, allocateReturnAudit, allocateReturnDelete } from '@/api/allocateReturn'
 export default {
   name: 'TransferReturnList',
   mixins: [commonMixin],
@@ -174,31 +176,34 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      time: [],
-      allocateTypeVal: [],
-      queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
+      tableHeight: 0, // 表格高度
+      time: [], // 创建时间
+      allocateTypeVal: [], // 费用/调拨退货类型
+      //  查询条件
+      queryParam: {
+        beginDate: '', // 开始时间
+        endDate: '', // 结束时间
         targetName: '', //  调往对象
         costTypeSn: undefined, // 费用类型
         allocateSortSn: undefined, //  调拨类别
         allocateReturnTypeSn: undefined, // 调拨退货类型2
         state: undefined, //  业务状态
-        warehouseSn: undefined,
+        warehouseSn: undefined, // 出库仓库
         allocateReturnNo: '', //  调拨单号
-        bizUserSn: undefined
+        bizUserSn: undefined// 客服
       },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
+      exportLoading: false, // 导出按钮加载状态
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return allocateReturnQueryPage(Object.assign(parameter, this.queryParam, { authWarehouseFlag: 0 })).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
@@ -209,13 +214,14 @@ export default {
           return data
         })
       },
-      visibleAudit: false,
-      auditInfo: null,
-      spinningAudit: false,
+      visibleAudit: false, // 审核弹窗
+      auditInfo: null, // 审核当前行数据
+      spinningAudit: false, // 审核按钮加载状态
       openModal: false //  新增编辑  弹框
     }
   },
   computed: {
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -247,6 +253,7 @@ 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] : ''
@@ -295,7 +302,7 @@ export default {
       this.auditInfo = row
       this.visibleAudit = true
     },
-    // 审核
+    // 审核成功
     auditOrder (state) {
       const _this = this
       _this.spinningAudit = true
@@ -334,6 +341,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -341,12 +349,14 @@ export default {
       })
       this.openModal = false
     },
+    // 表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 255
     }
   },
   watch: {
+    // 展开关闭  监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 10 - 7
src/views/allocationManagement/transferReturn/print.vue

@@ -5,7 +5,7 @@
       type="primary"
       class="button-info"
       v-if="$hasPermissions('B_transferReturnPrint')"
-      id="editGrap-db-print-btn"
+      id="transferReturn-db-print-btn"
       :disabled="disabled"
       @click="handlePrint('preview')">打印预览</a-button>
     <a-button
@@ -13,7 +13,7 @@
       type="primary"
       class="button-info"
       v-if="$hasPermissions('B_transferReturnPrint')"
-      id="editGrap-dbfl-print-btn"
+      id="transferReturn-dbfl-print-btn"
       :disabled="disabled"
       @click="handlePrint('print')">快捷打印</a-button>
     <a-divider type="vertical" />
@@ -22,7 +22,7 @@
       type="default"
       class="button-warning"
       v-if="$hasPermissions('B_transferReturnExport')"
-      id="editGrap-export-btn"
+      id="transferReturn-export-btn"
       :disabled="disabled"
       @click="handleExcel">导出Excel</a-button>
     <!-- 打印导出 -->
@@ -34,7 +34,9 @@
 
 <script>
 import { printFun, exportExcel } from '@/libs/JGPrint.js'
+// 组件
 import printModal from './printModal.vue'
+// 接口
 import { allocateReturnExcel, allocateReturnPrint } from '@/api/allocateReturn'
 export default {
   components: { printModal },
@@ -58,8 +60,8 @@ export default {
   },
   data () {
     return {
-      openModal: false,
-      nowType: null
+      openModal: false, // 打开打印导出
+      nowType: null// 打印类型
     }
   },
   methods: {
@@ -68,6 +70,7 @@ export default {
       this.nowType = type
       this.openModal = true
     },
+    // 打印导出
     handleOk (obj) {
       const _this = this
       const params = {
@@ -79,10 +82,10 @@ export default {
         params.orderBy = obj.orderBy
       }
       _this.$emit('loading')
-      printFun(allocateReturnPrint, params, obj.isPreview, '调拨退货单', () => { 
+      printFun(allocateReturnPrint, params, obj.isPreview, '调拨退货单', () => {
         _this.$emit('unloading')
         _this.$store.state.app.curActionPermission = ''
-     })
+      })
     },
     // 导出
     handleExcel () {

+ 20 - 17
src/views/allocationManagement/transferReturn/printModal.vue

@@ -20,23 +20,23 @@
         <a-form-model-item style="margin:0" label="调拨退货单号">{{ itemData&&itemData.allocateReturnNo || '--' }}</a-form-model-item>
         <a-form-model-item style="margin:0" label="调拨退货对象">{{ itemData&&itemData.targetName || '--' }}</a-form-model-item>
         <a-form-model-item label="产品价格" prop="priceType">
-          <a-radio-group v-model="form.priceType">
-            <a-radio value="thj" v-if="$hasPermissions('B_transferReturnPrint_salesPrice')">退货价</a-radio>
-            <a-radio value="cbj" v-if="$hasPermissions('B_transferReturnPrint_costPrice')">成本价</a-radio>
-            <a-radio value="bdy">不打印</a-radio>
+          <a-radio-group id="allocateBill-print-priceType" v-model="form.priceType">
+            <a-radio value="thj" id="allocateBill-print-priceType1" v-if="$hasPermissions('B_transferReturnPrint_salesPrice')">退货价</a-radio>
+            <a-radio value="cbj" id="allocateBill-print-priceType2" v-if="$hasPermissions('B_transferReturnPrint_costPrice')">成本价</a-radio>
+            <a-radio value="bdy" id="allocateBill-print-priceType3">不打印</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 id="allocateBill-print-orderBy" v-model="form.orderBy">
+            <a-radio value="ASC" id="allocateBill-print-orderBy1">打印(↑升序)</a-radio>
+            <a-radio value="DESC" id="allocateBill-print-orderBy2">打印(↓降序)</a-radio>
+            <a-radio value="-1" id="allocateBill-print-orderBy3">不打印</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>
-        <a-button type="primary" id="allocateBill-print-back" @click="handleSave(1)" style="margin-left: 15px;">确定</a-button>
+        <a-button id="allocateBill-print-cancel" @click="handleSave(0)">取消</a-button>
+        <a-button type="primary" id="allocateBill-print-save" @click="handleSave(1)" style="margin-left: 15px;">确定</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -62,21 +62,24 @@ export default {
   },
   data () {
     return {
+      spinning: false,
       isShow: this.openModal, //  是否打开弹框
+      // 提交参数
       form: {
         id: 'all',
-        priceType: undefined,
-        orderBy: undefined
+        priceType: undefined, // 产品价格
+        orderBy: undefined// 货位编号
       },
+      // 表单验证规则
       rules: {
         priceType: [{ required: true, message: '请选择产品价格', trigger: 'change' }],
         orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }]
       },
+      // form表单label布局
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 18 }
-      },
-      spinning: false
+      }
     }
   },
   methods: {
@@ -120,9 +123,9 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
-      }else{
-        if(!this.$hasPermissions('B_transferReturnPrint_salesPrice')&&!this.$hasPermissions('B_transferReturnPrint_costPrice')){
-          this.form.priceType = "bdy"
+      } else {
+        if (!this.$hasPermissions('B_transferReturnPrint_salesPrice') && !this.$hasPermissions('B_transferReturnPrint_costPrice')) {
+          this.form.priceType = 'bdy'
         }
       }
     }

+ 65 - 49
src/views/allocationManagement/transfersPrint/list.vue

@@ -1,23 +1,23 @@
 <template>
-  <div class="allocateBillList-wrap">
+  <div class="transfersPrintList-wrap">
     <a-card size="small" :bordered="false" :class="currentTab==2 ? 'searchBox' : 'searchBoxNormal'">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="transfersPrintList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="transfersPrintList-time" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="调往对象">
-                <a-input id="allocateBillList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
+                <a-input id="transfersPrintList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调往对象"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="收货客户名称">
-                <dealerSearchList ref="receiverSn" @change="custChange"/>
+                <dealerSearchList id="transfersPrintList-receiver" ref="receiverSn" @change="custChange"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24" v-if="currentTab==2&&!isShowCustomerSearch">
@@ -25,7 +25,7 @@
                 <v-select
                   v-model="queryParam.state"
                   ref="state"
-                  id="allocateBillList-state"
+                  id="transfersPrintList-state"
                   code="ALLOCATE_STATUS"
                   placeholder="请选择业务状态"
                   allowClear
@@ -38,7 +38,7 @@
                   <v-select
                     v-model="queryParam.state"
                     ref="state"
-                    id="allocateBillList-state"
+                    id="transfersPrintList-state"
                     code="ALLOCATE_STATUS"
                     placeholder="请选择业务状态"
                     allowClear
@@ -47,7 +47,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="调拨单号">
-                  <a-input id="allocateBillList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
+                  <a-input id="transfersPrintList-allocateNo" v-model.trim="queryParam.allocateNo" allowClear placeholder="请输入调拨单号"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" v-if="currentTab == 1">
@@ -55,7 +55,7 @@
                   <v-select
                     v-model="queryParam.printState"
                     ref="printState"
-                    id="allocateBillList-printState"
+                    id="transfersPrintList-printState"
                     code="PRINT_STATUS"
                     placeholder="请选择打印状态"
                     allowClear
@@ -67,31 +67,31 @@
                   <warehouse
                     v-model="queryParam.warehouseSn"
                     isPermission
-                    id="allocateBillList-warehouseSn"
+                    id="transfersPrintList-warehouseSn"
                     placeholder="请选择调出仓库"
                   />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="所在区域">
-                  <subarea id="allocateBillList-subarea" ref="subarea" @change="subareaChange"></subarea>
+                  <subarea id="transfersPrintList-subarea" ref="subarea" @change="subareaChange"></subarea>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="地区">
-                  <Area id="allocateBillList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+                  <Area id="transfersPrintList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
                 <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                  <customerService ref="customerName" id="transfersPrintList-bizUserSn" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-item>
               </a-col>
             </template>
             <a-col :md="currentTab==2&&!isShowCustomerSearch ?24:6" :sm="24" :style="{textAlign: (currentTab==2&&!isShowCustomerSearch)?'center':''}">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="allocateBillList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateBillList-reset">重置</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="transfersPrintList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="transfersPrintList-reset">重置</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="transfersPrintList-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -101,10 +101,10 @@
       </div>
     </a-card>
     <div style="background-color: #fff;">
-      <a-tabs v-model="currentTab" @change="changeTab">
-        <a-tab-pane :key="1" tab="全部">
+      <a-tabs v-model="currentTab" @change="changeTab" id="transfersPrintList-tabs">
+        <a-tab-pane :key="1" tab="全部" id="transfersPrintList-tabs1">
         </a-tab-pane>
-        <a-tab-pane :key="2" tab="待打印">
+        <a-tab-pane :key="2" tab="待打印" id="transfersPrintList-tabs2">
         </a-tab-pane>
       </a-tabs>
     </div>
@@ -124,12 +124,12 @@
           bordered>
           <!-- 单号 -->
           <template slot="allocateNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('M_transferOut_detail')" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
+            <span v-if="$hasPermissions('M_transferOut_detail')" :id="'transfersPrintList-allocateNo'+record.id" class="link-bule" @click="handleDetail(record)">{{ record.allocateNo }}</span>
             <span v-else>{{ record.allocateNo }}</span>
           </template>
           <!-- 打印状态 -->
           <template slot="printStatus" slot-scope="text, record">
-            <span v-if="record.printState=='NO_PRINT'" class="link-bule" @click="editPrintStatus(record)">{{ record.printStateDictValue }}</span>
+            <span v-if="record.printState=='NO_PRINT'" :id="'transfersPrintList-printStatus'+record.id" class="link-bule" @click="editPrintStatus(record)">{{ record.printStateDictValue }}</span>
             <span v-else>{{ record.printStateDictValue }}</span>
           </template>
           <div slot="costTitle">
@@ -148,14 +148,14 @@
               v-if="record.printState == 'NO_PRINT'&&$hasPermissions('B_transferOut_type_print')"
               class="button-warning"
               @click="handlePrint(record)"
-              id="allocateBillList-printState">调拨分类打印</a-button>
+              :id="'transfersPrintList-printState-btn'+record.id">调拨分类打印</a-button>
             <a-button
               size="small"
               type="link"
               v-else-if="record.printState == 'PRINT'&&$hasPermissions('B_tfoPrint_record')"
               class="button-success"
               @click="handlePrintRecord(record)"
-              id="allocateBillList-printRecord">打印记录</a-button>
+              :id="'transfersPrintList-printRecord-btn'+record.id">打印记录</a-button>
             <span v-else>--</span>
           </template>
         </s-table>
@@ -198,6 +198,8 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
+import { printBase64Fun } from '@/libs/JGPrint.js'
+// 组件
 import { STable, VSelect } from '@/components'
 import subarea from '@/views/common/subarea.js'
 import Area from '@/views/common/area.js'
@@ -209,8 +211,8 @@ import warehouse from '@/views/common/chooseWarehouse.js'
 import customerService from '@/views/common/customerService'
 import allocationDetailModal from '@/views/allocationManagement/transferOut/detail.vue'
 import recordModal from './recordModal.vue'
+// 接口
 import { allocateBillList, allocateBillDetailPrint, updatePrintState } from '@/api/allocateBill'
-import { printBase64Fun } from '@/libs/JGPrint.js'
 export default {
   name: 'TransfersPrintList',
   mixins: [commonMixin],
@@ -219,44 +221,48 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      itemData: null,
-      bizSn: '',
-      showRecordModal: false,
-      showPrintModal: false,
-      showDetailModal: false,
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      itemData: null, // 当前行数据
+      bizSn: '', // 调拨sn
+      showRecordModal: false, // 打印记录弹窗
+      showPrintModal: false, // 打印弹窗
+      showDetailModal: false, // 调拨单详情弹窗
+      // 创建时间默认值
       time: [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'), // 开始时间
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')// 几位数使劲
       ],
-      queryParam: { //  查询条件
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+      //  查询条件
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         targetName: '', //  调往对象
         state: undefined, //  业务状态
         allocateNo: '', //  调拨单号
-        receiverSn: undefined,
-        checkStatus: undefined,
-        warehouseSn: undefined,
-        printState: 'NO_PRINT',
+        receiverSn: undefined, // 收货客户名称
+        checkStatus: undefined, // 选中状态
+        warehouseSn: undefined, // 调出仓库
+        printState: 'NO_PRINT', // 打印状态
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined// 分区
         },
-        shippingAddrProvinceSn: undefined,
-        bizUserSn: undefined
+        shippingAddrProvinceSn: undefined, // 选中省份
+        bizUserSn: undefined// 客服
       },
-      currentTab: 2,
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
+      currentTab: 2, // tabs默认值
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return allocateBillList(Object.assign(parameter, this.queryParam, { authWarehouseFlag: 1 })).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
@@ -267,12 +273,13 @@ export default {
           return data
         })
       },
-      visibleAudit: false,
+      visibleAudit: false, // 审核弹窗
       openModal: false, //  打印弹框
-      tipData: null
+      tipData: null// 操作提示回显数据
     }
   },
   computed: {
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -305,6 +312,7 @@ export default {
     }
   },
   methods: {
+    // 收货客户名称 change
     custChange (val) {
       if (val.row) {
         this.queryParam.receiverSn = val.row.dealerSn
@@ -314,6 +322,7 @@ export default {
         this.queryParam.receiverName = val.key
       }
     },
+    // tabs事件
     changeTab (v) {
       this.currentTab = v
       this.resetSearchForm()
@@ -323,6 +332,7 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 区域分区
     subareaChange (val) {
       this.queryParam.subareaArea = {
         subareaSn: val[0] ? val[0] : undefined,
@@ -396,11 +406,13 @@ export default {
       this.bizSn = row.allocateSn
       this.showDetailModal = true
     },
+    // 关闭详情弹窗
     cancelDetail () {
       this.showDetailModal = false
       this.$store.state.app.curActionPermission = ''
       this.bizSn = null
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -408,6 +420,7 @@ export default {
       })
       this.openModal = false
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 266
@@ -419,10 +432,12 @@ export default {
         this.showPrintModal = true
       })
     },
+    // 关闭操作提示弹窗
     canselModal () {
       this.showPrintModal = false
       this.resetSearchForm()
     },
+    // 操作提示成功呢
     updatePrintStatus () {
       const _this = this
       _this.spinning = true
@@ -440,6 +455,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -474,7 +490,7 @@ export default {
 }
 </script>
 <style lang="less">
-  .allocateBillList-wrap{
+  .transfersPrintList-wrap{
     .ant-tabs-bar{
       margin: 0;
     }

+ 10 - 4
src/views/allocationManagement/transfersPrint/recordModal.vue

@@ -45,14 +45,16 @@
         bordered>
       </s-table>
       <div class="btn-box">
-        <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
+        <a-button :id="'record-cancel-'+record.id" @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
       </div>
     </a-spin>
   </a-modal>
 </template>
 
 <script>
+// 组件
 import { STable, VSelect } from '@/components'
+// 接口
 import { printLogQueryPage } from '@/api/data'
 export default {
   name: 'RecordModal',
@@ -78,10 +80,11 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      disabled: false,
+      disabled: false, // 查询、重置按钮是否可操作
       spinning: false,
-      tipData: null,
-      params: null,
+      tipData: null, // 调拨当前数据
+      params: null, // 提交数据
+      // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '打印时间', dataIndex: 'printDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -93,10 +96,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return printLogQueryPage(Object.assign(parameter, this.params || {})).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -110,6 +115,7 @@ export default {
     }
   },
   methods: {
+    // 赋值
     setData (data, params) {
       this.tipData = data
       this.params = params

+ 12 - 4
src/views/basicData/transferTypeManagement/editModal.vue

@@ -33,8 +33,8 @@
           </a-form-model-item>
         </a-form-model>
         <div class="btn-cont">
-          <a-button id="storeTransferOut-type-edit-modal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
-          <a-button type="primary" id="storeTransferOut-type-edit-modal-save" @click="handleSave">保存</a-button>
+          <a-button id="transferTypeManagementEdit-cancel" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+          <a-button type="primary" id="transferTypeManagementEdit-save" @click="handleSave">保存</a-button>
         </div>
       </a-spin>
     </div>
@@ -43,9 +43,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect } from '@/components'
-import { allocateTypeSave } from '@/api/allocateType'
 import allocateType from '@/views/common/allocateType'
+// 接口
+import { allocateTypeSave } from '@/api/allocateType'
 export default {
   name: 'TransferTypeManagementEditModal',
   mixins: [commonMixin],
@@ -65,6 +67,7 @@ export default {
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       return (this.itemSn ? '编辑' : '新增') + '调拨类型'
     }
@@ -73,16 +76,19 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // form 表单
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
-      allocateType: [],
+      allocateType: [], // 调拨类别
+      // 提交参数
       form: {
         name: '', // 调拨类型名称
         allocateCategory: undefined, //  调拨类别
         treeLevel: 3
       },
+      // 表单验证规则
       rules: {
         allocateCategory: [
           { required: true, message: '请选择调拨类别', trigger: 'change' }
@@ -94,6 +100,7 @@ export default {
     }
   },
   methods: {
+    // 调拨类型名称 去空格
     filterEmpty () {
       let str = this.form.name
       str = str.replace(/\ +/g, '')
@@ -101,6 +108,7 @@ export default {
       str = str.replace(/[\r\n]/g, '')
       this.form.name = str
     },
+    // 调拨类别 change
     changeCategory (v, opt) {
       this.form.allocateCategory = v && v[1] ? v[1] : ''
     },

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

@@ -30,14 +30,14 @@
             class="button-info"
             @click="handleEdit(record)"
             v-if="$hasPermissions('B_transferTypeManagement_edit')"
-            id="transferTypeManagementList-edit-btn">编辑</a-button>
+            :id="'transferTypeManagementList-edit-btn-'+record.id">编辑</a-button>
           <a-button
             size="small"
             type="link"
             class="button-error"
             @click="handleDel(record)"
             v-if="$hasPermissions('B_transferTypeManagement_del')"
-            id="transferTypeManagementList-del-btn">删除</a-button>
+            :id="'transferTypeManagementList-del-btn-'+record.id">删除</a-button>
           <span v-if="!$hasPermissions('B_transferTypeManagement_del') &&!$hasPermissions('B_transferTypeManagement_edit')">--</span>
         </template>
       </s-table>
@@ -49,8 +49,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import transferTypeManagementEditModal from './editModal.vue'
+// 接口
 import { allocateTypeList, allocateTypeDel } from '@/api/allocateType'
 export default {
   name: 'TransferTypeManagementList',
@@ -59,7 +61,7 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -71,10 +73,12 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
+        // 获取列表数据 有分页
         return allocateTypeList(Object.assign(parameter, {})).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
@@ -123,12 +127,14 @@ export default {
       this.openModal = false
       this.$refs.table.refresh(true)
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 185

+ 18 - 12
src/views/basicData/warehouse/editModal.vue

@@ -48,7 +48,7 @@
             <v-select
               v-model="form.warehouseType"
               ref="state"
-              id="allocateBillList-state"
+              id="warehouseEdit-state"
               code="WAREHOUSE_TYPE"
               placeholder="请选择仓库类型"
               allowClear
@@ -73,9 +73,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
-import { warehouseSave } from '@/api/warehouse'
 import AreaList from '@/views/common/areaList.js'
+// 接口
+import { warehouseSave } from '@/api/warehouse'
 export default {
   name: 'WarehouseEditModal',
   mixins: [commonMixin],
@@ -103,22 +105,24 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // 表单 label 布局
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
+      // 提交参数
       form: {
         name: '', // 仓库名称
-        address: '',
-        addressInfo: undefined,
-        provinceSn: undefined,
-        provinceName: undefined,
-        citySn: undefined,
-        cityName: undefined,
-        districtSn: undefined,
-        districtName: undefined,
+        address: '', // 详细地址
+        addressInfo: undefined, // 选择省市区
+        provinceSn: undefined, // 省份sn
+        provinceName: undefined, // 省份名称
+        citySn: undefined, // 市sn
+        cityName: undefined, // 市名称
+        districtSn: undefined, // 区sn
+        districtName: undefined, // 区名称
         erpWarehouseCode: undefined, // ERP仓库编码
-        warehouseType: undefined
+        warehouseType: undefined// 仓库类型
       },
       rules: {
         name: [
@@ -140,6 +144,7 @@ export default {
     }
   },
   methods: {
+    // 仓库名称 去除空格
     filterEmpty () {
       let str = this.form.name
       str = str.replace(/\ +/g, '')
@@ -147,6 +152,7 @@ export default {
       str = str.replace(/[\r\n]/g, '')
       this.form.name = str
     },
+    // 地区
     areaChange (val, row) {
       this.form.addressInfo = val
       this.form.provinceSn = val[0] ? val[0] : ''
@@ -170,7 +176,7 @@ export default {
           districtSn: this.nowData.districtSn ? this.nowData.districtSn : '',
           districtName: this.nowData.districtName ? this.nowData.districtName : '',
           erpWarehouseCode: this.nowData.erpWarehouseCode ? this.nowData.erpWarehouseCode : '', // ERP仓库编码
-          warehouseType:this.nowData.warehouseType ? this.nowData.warehouseType : '',
+          warehouseType: this.nowData.warehouseType ? this.nowData.warehouseType : '',
           addressInfo: addressVal
         }
       }

+ 8 - 2
src/views/basicData/warehouse/list.vue

@@ -71,9 +71,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { warehouseList, warehouseDel } from '@/api/warehouse'
+// 组件
 import { STable } from '@/components'
 import warehouseEditModal from './editModal.vue'
+// 接口
+import { warehouseList, warehouseDel } from '@/api/warehouse'
 export default {
   name: 'WarehouseList',
   mixins: [commonMixin],
@@ -84,7 +86,7 @@ export default {
       queryParam: { //  查询条件
         name: '' //  仓库名称
       },
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
@@ -96,10 +98,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return warehouseList(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
@@ -164,12 +168,14 @@ export default {
     goStoringLocation (row) {
       this.$router.push({ path: `/basicData/storingLocation/${row.warehouseSn}`, query: { name: row.name } })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 250

+ 7 - 1
src/views/basicData/warehouse/storingLocation/editModal.vue

@@ -29,7 +29,7 @@
           </a-form-model-item>
           <a-form-model-item label="所属仓库" prop="warehouseSn">
             <a-select id="storingLocationEdit-warehouseSn" disabled placeholder="请选择所属仓库" allowClear v-model="form.warehouseSn">
-              <a-select-option v-for="item in warehouseList" :key="item.id" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+              <a-select-option :id="'storingLocationEdit-warehouseSn-'+item.id" v-for="item in warehouseList" :key="item.id" :value="item.warehouseSn">{{ item.name }}</a-select-option>
             </a-select>
           </a-form-model-item>
         </a-form-model>
@@ -44,7 +44,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable } from '@/components'
+// 接口
 import { warehouseLocSave, warehouseAllList } from '@/api/warehouse'
 export default {
   name: 'StoringLocationEditModal',
@@ -65,6 +67,7 @@ export default {
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       return (this.itemSn ? '编辑' : '新增') + '仓位'
     }
@@ -73,14 +76,17 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // form表单 label布局
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
+      // 提交参数
       form: {
         name: '', // 仓位名称
         warehouseSn: undefined //  所属仓库
       },
+      // 表单验证规则
       rules: {
         name: [
           { required: true, message: '请输入仓位名称', trigger: 'blur' }

+ 14 - 7
src/views/basicData/warehouse/storingLocation/list.vue

@@ -11,7 +11,7 @@
       <a-card size="small" :bordered="false" class="storingLocationList-cont">
         <!-- 搜索条件 -->
         <div ref="tableSearch" class="table-page-search-wrapper">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-form layout="inline" id="storingLocationList-form" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-item label="仓位名称">
@@ -49,14 +49,14 @@
               class="button-info"
               v-if="record.defaultFlag!='1'"
               @click="handleEdit(record)"
-              id="storingLocationList-edit-btn">编辑</a-button>
+              :id="'storingLocationList-edit-btn-'+record.id">编辑</a-button>
             <a-button
               size="small"
               type="link"
               class="button-error"
               v-if="record.defaultFlag!='1'"
               @click="handleDel(record)"
-              id="storingLocationList-del-btn">删除</a-button>
+              :id="'storingLocationList-del-btn-'+record.id">删除</a-button>
             <span v-if="record.defaultFlag=='1'">--</span>
           </template>
         </s-table>
@@ -69,9 +69,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { warehouseLocList, warehouseLocDel } from '@/api/warehouse'
+// 组件
 import { STable } from '@/components'
 import storingLocationEditModal from './editModal.vue'
+// 接口
+import { warehouseLocList, warehouseLocDel } from '@/api/warehouse'
 export default {
   name: 'StoringLocationList',
   mixins: [commonMixin],
@@ -79,12 +81,13 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      //  查询条件
+      queryParam: {
         warehouseSn: this.$route.params.sn, //  仓库sn
         name: '' //  仓位名称
       },
-      disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
         { title: '仓位名称', dataIndex: 'name', align: 'center', width: '45%', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -94,10 +97,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return warehouseLocList(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
@@ -168,12 +173,14 @@ export default {
     handleBack () {
       this.$router.push({ path: '/basicData/warehouse/list', query: { closeLastOldTab: true } })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 295

+ 3 - 1
src/views/common/chooseProductsModal.vue

@@ -133,7 +133,7 @@ export default {
       loading: false, //  表格加载中
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
-        { title: '产品编码', dataIndex: 'code', align: 'left',width: 200 },
+        { title: '产品编码', dataIndex: 'code', align: 'left', width: 200 },
         { title: '产品名称', dataIndex: 'name', align: 'left', ellipsis: true, customRender: function (text) { return text || '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -145,6 +145,7 @@ export default {
           url = productPricingList //  获取定价产品
         }
         const params = Object.assign(parameter, this.queryParam)
+        // 不是供应商也不是经销权选择产品
         if (this.type != 'supplier' && this.type != 'dealership') { //  促销
           params.onlineFalg = 1
         }
@@ -291,6 +292,7 @@ export default {
           })
         }
         this.$nextTick(() => { // 页面渲染完成后的回调
+          _this.handleSearch() // 重新渲染表格
           _this.$refs.table.setTableSelected(selectedRowKeys, selectedRows) // 设置表格选中项
         })
       }

+ 14 - 5
src/views/common/supplier.js

@@ -40,6 +40,10 @@ const Employee = {
     isPermission: {
       type: Boolean,
       default: false
+    },
+    pageSn: {
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -69,16 +73,21 @@ const Employee = {
       this.$emit('change', value, item)
     },
     getList () {
-      const funs = this.isPermission ? supplierAuthAllList : supplierAllList
+      const _this = this
+      const funs = _this.isPermission ? supplierAuthAllList : supplierAllList
       funs().then(res => {
         if (res.status == 200) {
-          if (this.enableFlag != '') {
-            this.list = res.data.filter(item => item.enableFlag == this.enableFlag)
+          if (_this.enableFlag != '') {
+            if (_this.pageSn === '福麦斯') {
+              _this.list = res.data.filter(item => item.supplierName.includes('福麦斯'))
+            } else {
+              _this.list = res.data.filter(item => item.enableFlag == _this.enableFlag)
+            }
           } else {
-            this.list = res.data
+            _this.list = res.data
           }
         } else {
-          this.list = []
+          _this.list = []
         }
       })
     }

+ 30 - 24
src/views/dataExport/exportCheck/list.vue

@@ -29,7 +29,7 @@
           <a-row :gutter="15">
             <a-col :md="12" :sm="24">
               <a-form-model-item label="选择盘点单" prop="checkWarehouseSn">
-                <a-select id="exportCheckList-print" v-model="queryParam.checkWarehouseSn" placeholder="请选择盘点单" allowClear>
+                <a-select id="exportCheckList-checkWarehouseSn" v-model="queryParam.checkWarehouseSn" placeholder="请选择盘点单" allowClear>
                   <a-select-option v-for="item in checkList" :value="item.checkWarehouseSn" :key="item.checkWarehouseSn">
                     <span>{{ item.financeAuditTime }} - {{ item.checkWarehouseNo }}</span>
                   </a-select-option>
@@ -39,13 +39,13 @@
           </a-row>
           <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }">
             <a-button
-                type="primary"
-                class="button-warning"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                id="exportCheckList-export">导出</a-button>
-            <a-button @click="pageInit" style="margin-left: 15px" id="chooseCustom-btn-back">重置</a-button>
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              id="exportCheckList-export">导出</a-button>
+            <a-button @click="pageInit" style="margin-left: 15px" id="exportCheckList-reset">重置</a-button>
           </a-form-model-item>
         </a-form-model>
       </div>
@@ -55,10 +55,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
-import { checkWarehouseExcelList, checkWarehouseExport } from '@/api/checkWarehouse'
 import warehouse from '@/views/common/chooseWarehouse.js'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
+import { checkWarehouseExcelList, checkWarehouseExport } from '@/api/checkWarehouse'
 export default {
   name: 'ExportCheckList',
   mixins: [commonMixin],
@@ -66,28 +68,30 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
-      labelCol: { span: 8 },
-      wrapperCol: { span: 16 },
-      queryParam: { //  查询条件
-        checkWarehouseSn: undefined,
-        warehouseSn: undefined
+      labelCol: { span: 8 }, // label 标签布局
+      wrapperCol: { span: 16 }, // 表单设置布局
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        checkWarehouseSn: undefined, // 盘点单 sn
+        warehouseSn: undefined// 仓库sn
       },
+      // 表单验证规则
       rules: {
         checkWarehouseSn: [{ required: true, message: '请选择盘点单', trigger: 'change' }],
         warehouseSn: [{ required: true, message: '请选择仓库', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      checkList: []
+      checkList: []// 盘点单数据
     }
   },
   methods: {
+    // 获取盘点单数据
     getList (v) {
       this.queryParam.checkWarehouseSn = undefined
       this.checkList = []
-      if(v){
-        checkWarehouseExcelList({warehouseSn: this.queryParam.warehouseSn}).then(res => {
+      if (v) {
+        checkWarehouseExcelList({ warehouseSn: this.queryParam.warehouseSn }).then(res => {
           if (res.status == 200) {
             this.checkList = res.data || []
           } else {
@@ -114,15 +118,17 @@ export default {
         }
       })
     },
-    loadWareHouse(){
+    // 加载仓库信息
+    loadWareHouse () {
       const defWareHouse = this.$store.state.app.defWarehouse
       this.queryParam.checkWarehouseSn = undefined
-      this.queryParam.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse?defWareHouse.warehouseSn:undefined)
+      this.queryParam.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse ? defWareHouse.warehouseSn : undefined)
 
-      if(!this.isShowWarehouse){
+      if (!this.isShowWarehouse) {
         this.getList(true)
       }
     },
+    // 初始化数据
     pageInit () {
       this.$refs.ruleForm.resetFields()
     }

+ 34 - 29
src/views/dataExport/exportSales/list.vue

@@ -1,10 +1,10 @@
 <template>
-  <a-card size="small" :bordered="false" class="exportCheckList-wrap">
+  <a-card size="small" :bordered="false" class="exportSalesList-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
       <div ref="tableSearch">
         <a-form-model
-          id="exportCheckList-form"
+          id="exportSalesList-form"
           ref="ruleForm"
           class="form-model-con"
           :model="queryParam"
@@ -19,7 +19,7 @@
                   v-model="queryParam.warehouseSn"
                   isPermission
                   @load="loadWareHouse"
-                  id="exportCheckList-warehouseSn"
+                  id="exportSalesList-warehouseSn"
                   placeholder="请选择仓库"
                   @change="getList"
                 />
@@ -29,7 +29,7 @@
           <a-row :gutter="15">
             <a-col :md="12" :sm="24">
               <a-form-model-item label="选择时间范围" prop="dateArr">
-                <a-select id="exportCheckList-print" v-model="queryParam.dateArr" placeholder="请选择时间范围" allowClear>
+                <a-select id="exportSalesList-dateArr" v-model="queryParam.dateArr" placeholder="请选择时间范围" allowClear>
                   <a-select-option v-for="item in checkList" :value="item" :key="item">
                     <span>{{ item }}</span>
                   </a-select-option>
@@ -39,13 +39,13 @@
           </a-row>
           <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }">
             <a-button
-                type="primary"
-                class="button-warning"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                id="exportCheckList-export">导出</a-button>
-            <a-button @click="pageInit" style="margin-left: 15px" id="chooseCustom-btn-back">重置</a-button>
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              id="exportSalesList-export">导出</a-button>
+            <a-button @click="pageInit" style="margin-left: 15px" id="exportSalesList-reset">重置</a-button>
           </a-form-model-item>
         </a-form-model>
       </div>
@@ -55,11 +55,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
+import warehouse from '@/views/common/chooseWarehouse.js'
+// 接口
 import { checkWarehouseExcelList } from '@/api/checkWarehouse'
 import { exportSalesOutProduct } from '@/api/stockOut.js'
-import warehouse from '@/views/common/chooseWarehouse.js'
-import { hdExportExcel } from '@/libs/exportExcel'
 export default {
   name: 'ExportSalesList',
   mixins: [commonMixin],
@@ -67,28 +69,29 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
-      labelCol: { span: 8 },
-      wrapperCol: { span: 16 },
-      queryParam: { //  查询条件
-        dateArr: undefined,
-        warehouseSn: undefined
+      labelCol: { span: 8 }, // form表单label横向距离
+      wrapperCol: { span: 16 }, // form表单行缩进距离
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        dateArr: undefined, // 时间范围
+        warehouseSn: undefined// 仓库
       },
       rules: {
-        'dateArr': [{ required: true, message: '请选择时间范围', trigger: 'change' }],
+        dateArr: [{ required: true, message: '请选择时间范围', trigger: 'change' }],
         warehouseSn: [{ required: true, message: '请选择仓库', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      checkList: []
+      checkList: []// 时间范围数据
     }
   },
   methods: {
+    // 获取时间范围数据
     getList (v) {
       this.queryParam.dateArr = undefined
       this.checkList = []
-      if(v){
-        checkWarehouseExcelList({warehouseSn: this.queryParam.warehouseSn}).then(res => {
+      if (v) {
+        checkWarehouseExcelList({ warehouseSn: this.queryParam.warehouseSn }).then(res => {
           if (res.status == 200) {
             const arr = res.data.reverse()
             for (let i = arr.length - 1; i > 0; i--) {
@@ -118,15 +121,17 @@ export default {
         }
       })
     },
-    loadWareHouse(){
+    // 选择仓库 change
+    loadWareHouse () {
       const defWareHouse = this.$store.state.app.defWarehouse
       this.queryParam.dateArr = undefined
-      this.queryParam.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse?defWareHouse.warehouseSn:undefined)
+      this.queryParam.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse ? defWareHouse.warehouseSn : undefined)
 
-      if(!this.isShowWarehouse){
+      if (!this.isShowWarehouse) {
         this.getList(true)
       }
     },
+    // 初始化数据
     pageInit () {
       this.$refs.ruleForm.resetFields()
     }
@@ -152,7 +157,7 @@ export default {
 }
 </script>
 <style lang="less">
-  .exportCheckList-wrap{
+  .exportSalesList-wrap{
     height: 99%;
     .form-model-con{
       margin-top: 50px;

+ 27 - 18
src/views/dealerManagement/businessOwnerSettings/addModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="businessOwnerSettings-modal"
+    class="businessOwnerSettings-add-modal"
     :footer="null"
     :maskClosable="false"
     :title="itemId ?'编辑人员':'新增人员'"
@@ -13,23 +13,24 @@
         ref="ruleForm"
         :model="form"
         :label-col="labelCol"
+        id="businessOwnerSettings-add-form"
         :wrapper-col="wrapperCol"
         :rules="rules"
       >
         <a-form-model-item label="人员名称" prop="userSn">
-          <userName ref="userName" id="businessOwnerSettings-userSn" @change="userChange"></userName>
+          <userName ref="userName" id="businessOwnerSettings-add-userSn" @change="userChange"></userName>
         </a-form-model-item>
         <a-form-model-item label="人员类型" prop="bizUserType">
           <v-select
             v-model="form.bizUserType"
             ref="printStatus"
-            id="businessOwnerSettings-printStatus"
+            id="businessOwnerSettings-add-printStatus"
             code="BIZ_USER_TYPE"
             placeholder="请选择人员类型"
             allowClear></v-select>
         </a-form-model-item>
         <a-form-model-item label="管辖经销商" prop="allDealerFlag">
-          <a-radio-group v-model="form.allDealerFlag">
+          <a-radio-group v-model="form.allDealerFlag" id="businessOwnerSettings-add-allDealerFlag">
             <a-radio value="1">
               全部经销商
             </a-radio>
@@ -39,7 +40,7 @@
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="管辖品类" prop="allProductFlag">
-          <a-radio-group v-model="form.allProductFlag">
+          <a-radio-group v-model="form.allProductFlag" id="businessOwnerSettings-add-allProductFlag">
             <a-radio value="1">
               全部品类
             </a-radio>
@@ -50,7 +51,7 @@
         </a-form-model-item>
         <!-- 供应商 -->
         <a-form-model-item label="供应商" prop="allSupplierFlag" v-if="form.bizUserType == 'cg'">
-          <a-radio-group v-model="form.allSupplierFlag">
+          <a-radio-group v-model="form.allSupplierFlag" id="businessOwnerSettings-add-allSupplierFlag">
             <a-radio value="1">
               全部供应商
             </a-radio>
@@ -61,11 +62,11 @@
         </a-form-model-item>
         <!-- 人员类型为仓库管理员时 显示管辖仓库 -->
         <a-form-model-item label="管辖仓库" prop="bizUserScopeList" v-if="form.bizUserType == 'cg'">
-          <chooseWarehouse ref="warehouse" modeType="multiple" :value="warehouseList" @change="handleWarehouse"></chooseWarehouse>
+          <chooseWarehouse ref="warehouse" id="businessOwnerSettings-add-bizUserType" modeType="multiple" :value="warehouseList" @change="handleWarehouse"></chooseWarehouse>
         </a-form-model-item>
         <div style="display: flex;justify-content: center;padding: 30px 0;">
-          <a-button @click="isShow=false">取消</a-button>
-          <a-button style="margin-left: 15px;" type="primary" @click="handleSave">{{ itemId?'保存':'确定' }}</a-button>
+          <a-button id="businessOwnerSettings-close-btn" @click="isShow=false">取消</a-button>
+          <a-button id="businessOwnerSettings-save-btn" style="margin-left: 15px;" type="primary" @click="handleSave">{{ itemId?'保存':'确定' }}</a-button>
         </div>
       </a-form-model>
     </a-spin>
@@ -73,13 +74,14 @@
 </template>
 
 <script>
-
+// 组件
 import userName from '@/views/common/userName'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import { VSelect } from '@/components'
+// 接口
 import { bizuserSave } from '@/api/bizuser.js'
 export default {
-  name: 'ProductInfoDetailModal',
+  name: 'BusinessOwnerSettings',
   components: { VSelect, userName, chooseWarehouse },
   props: {
     openModal: { //  弹框显示状态
@@ -96,17 +98,19 @@ export default {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
       form: {
-        userSn: '',
+        userSn: '', // 人员名称
         bizUserType: undefined, // 人员类型
-        allDealerFlag: undefined,
-        allProductFlag: undefined,
-        bizUserScopeList: [],
-        allSupplierFlag: undefined
+        allDealerFlag: undefined, // 管辖经销商
+        allProductFlag: undefined, // 管辖产品
+        bizUserScopeList: [], // 管辖仓库
+        allSupplierFlag: undefined// 供应商
       },
-      warehouseList: [],
-      user_name: '',
+      warehouseList: [], // 管辖仓库
+      user_name: '', // 用户名称
+      // 表单label布局
       labelCol: { span: 5 },
       wrapperCol: { span: 16 },
+      // 验证表单规则
       rules: {
         userSn: [{ required: true, message: '请输入人员名称', trigger: 'change' }],
         bizUserType: [{ required: true, message: '请选择人员类型', trigger: 'change' }],
@@ -118,6 +122,7 @@ export default {
     }
   },
   methods: {
+    // 保存
     handleSave () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -144,6 +149,7 @@ export default {
         }
       })
     },
+    // 管辖仓库 change
     handleWarehouse (val) {
       this.warehouseList = val
       const arr = []
@@ -155,6 +161,7 @@ export default {
       })
       this.form.bizUserScopeList = arr
     },
+    // 重置
     resetSearchForm () {
       this.user_name = ''
       if (this.form.bizUserType && this.form.bizUserType == 'cg') {
@@ -165,9 +172,11 @@ export default {
       this.$refs.userName.resetForm()
       this.$refs.ruleForm.resetFields()
     },
+    // 人员名称
     userChange (val) {
       this.form.userSn = val.key
     },
+    // 获取编辑回显数据
     getEditInfo (obj) {
       this.$refs.userName.setDufaultVal(obj.userName)
       const arr = []

+ 39 - 16
src/views/dealerManagement/businessOwnerSettings/categorySet.vue

@@ -2,8 +2,9 @@
   <div class="categorySet-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-card size="small" :bordered="false" class="categorySet-cont">
+        <!-- 操作按钮 -->
         <div class="table-operator" ref="categorySetAddBtn">
-          <a-button type="primary" @click="addCategory" :disabled="disabled">新增管辖品类</a-button>
+          <a-button type="primary" id="categorySet-add" @click="addCategory" :disabled="disabled">新增管辖品类</a-button>
         </div>
         <s-table
           class="sTable fixPagination"
@@ -22,19 +23,25 @@
             <div style="max-height:64px;overflow-y:scroll;">
               <a-row v-if="record.productTypeList && record.productTypeList.length>0">
                 <a-col :span="20">
-                  <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,con,'typeList')" v-for="(con,i) in record.productTypeList" :key="i">
+                  <a-tag
+                    :id="'categorySet-chooseType'+record.bizUserScopeSn"
+                    style="margin-bottom:10px;"
+                    closable
+                    @close.prevent="delLabel(record.bizUserScopeSn,con,'typeList')"
+                    v-for="(con,i) in record.productTypeList"
+                    :key="i">
                     {{ con.dataName }}
                   </a-tag>
                 </a-col>
                 <a-col :span="4" style="text-align:right;">
-                  <a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
+                  <a-tag style="background: #fff; borderStyle: dashed;" :id="'categorySet-chooseType-btn'+record.bizUserScopeSn" @click="addClassifyTag(index, record)" color="blue">
                     <a-icon type="plus" /> 选择
                   </a-tag>
                 </a-col>
               </a-row>
               <a-row v-else>
                 <a-col :span="24">
-                  <a-tag style="background: #fff; borderStyle: dashed;" @click="addClassifyTag(index, record)" color="blue">
+                  <a-tag style="background: #fff; borderStyle: dashed;" :id="'categorySet-chooseType-btn1'+record.bizUserScopeSn" @click="addClassifyTag(index, record)" color="blue">
                     <a-icon type="plus" /> 选择
                   </a-tag>
                 </a-col>
@@ -46,19 +53,25 @@
             <div style="max-height:64px;overflow-y:scroll;">
               <a-row v-if="record.productBrandList && record.productBrandList.length>0">
                 <a-col :span="20">
-                  <a-tag style="margin-bottom:10px;" closable @close.prevent="delLabel(record.bizUserScopeSn,item,'brandList')" v-for="(item,j) in record.productBrandList" :key="j">
+                  <a-tag
+                    style="margin-bottom:10px;"
+                    :id="'categorySet-chooseBrand'+record.bizUserScopeSn"
+                    closable
+                    @close.prevent="delLabel(record.bizUserScopeSn,item,'brandList')"
+                    v-for="(item,j) in record.productBrandList"
+                    :key="j">
                     {{ item.dataName }}
                   </a-tag>
                 </a-col>
                 <a-col :span="4" style="text-align:right;">
-                  <a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
+                  <a-tag style="background: #fff; borderStyle: dashed;" :id="'categorySet-chooseBrand-btn'+record.bizUserScopeSn" @click="addBrandTag(index, record)" color="blue">
                     <a-icon type="plus" /> 选择
                   </a-tag>
                 </a-col>
               </a-row>
               <a-row v-else>
                 <a-col :span="24">
-                  <a-tag style="background: #fff; borderStyle: dashed;" @click="addBrandTag(index, record)" color="blue">
+                  <a-tag style="background: #fff; borderStyle: dashed;" :id="'categorySet-chooseBrand-btn1'+record.bizUserScopeSn" @click="addBrandTag(index, record)" color="blue">
                     <a-icon type="plus" /> 选择
                   </a-tag>
                 </a-col>
@@ -70,6 +83,7 @@
               size="small"
               type="link"
               class="button-error"
+              :id="'categorySet-delete-btn'+record.bizUserScopeSn"
               @click="handleDel(record)"
             >
               删除
@@ -87,9 +101,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable } from '@/components'
 import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
 import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
-import { STable } from '@/components'
+// 接口
 import { getNewScopeSn, queryProductScopePage, saveProductBrandList, saveProductTypeList, bizuserScopeDelete, deleteProductBrand, deleteProductType } from '@/api/bizuser'
 export default {
   name: 'CategorySet',
@@ -104,24 +120,25 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '分类', dataIndex: 'no', width: '42%', align: 'center', scopedSlots: { customRender: 'classify' } },
         { title: '品牌', dataIndex: 'name', width: '42%', align: 'center', scopedSlots: { customRender: 'brand' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '16%', align: 'center' }
       ],
+      // 查询参数
       queryParam: {
         hasDetail: 1
       },
-      dataSource: [],
+      dataSource: [], // 列表数据
       openModal: false, //  新增编辑产品品牌  弹框
       itemSn: '', //  当前sn
       nowData: null, //  当前记录数据
-      openBrandModal: false,
-      openTypeModal: false,
-      chooseBrand: [],
-      chooseType: [],
+      openBrandModal: false, // 打开品牌弹窗
+      openTypeModal: false, // 打开分类弹窗
+      chooseBrand: [], // 选择品牌数据
+      chooseType: [], // 选择分类数据
       chooseObj: null, // 选择品牌 内容
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -129,11 +146,12 @@ export default {
         this.spinning = true
         this.queryParam.userSn = this.$route.query.sn
         this.queryParam.bizUserSn = this.bizUserSn
+        // 获取列表数据  有分页
         return queryProductScopePage(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
+          // 计算列表序号
           const no = (data.pageNo - 1) * data.pageSize
           this.total = data.count || 0
-
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
@@ -203,6 +221,7 @@ export default {
       this.chooseObj = row
       this.openTypeModal = true
     },
+    // 打开分类弹窗
     handleClassifyModal (con) {
       const chooseList = con
       this.openTypeModal = false
@@ -230,6 +249,7 @@ export default {
       this.chooseBrand = obj
       this.saveChangeData('BRAND')
     },
+    // 保存时重组数据
     saveChangeData (type) {
       const _this = this
       if (type == 'BRAND') { //  选择品牌
@@ -254,6 +274,7 @@ export default {
         }
       }
     },
+    // 保存
     save (list, type) {
       const ajaxdata = { userSn: this.$route.query.sn, bizUserScopeSn: this.chooseObj.bizUserScopeSn, bizUserSn: this.bizUserSn }
       if (type == 'BRAND') {
@@ -291,6 +312,7 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -298,6 +320,7 @@ export default {
       })
       this.$refs.table.refresh()
     },
+    // 计算表格高度
     setTableH () {
       const addBtnHeight = this.$refs.categorySetAddBtn.offsetHeight
       this.tableHeight = window.innerHeight - addBtnHeight - 325
@@ -316,6 +339,6 @@ export default {
 
 <style lang="less">
   .categorySet-wrap{
-     
+
   }
 </style>

+ 19 - 11
src/views/dealerManagement/businessOwnerSettings/chooseAreaModal.vue

@@ -10,12 +10,13 @@
     <div class="areaSetModal">
       <div :style="{ height: tableHeight+84.5+'px' }">
         <div>
-          <a-checkbox :checked="checkAll" @change="onCheckAllChange">全选</a-checkbox>
+          <a-checkbox id="chooseAreaModal-checkAll-btn" :checked="checkAll" @change="onCheckAllChange">全选</a-checkbox>
         </div>
         <div :style="{ height: tableHeight+30+'px' }" style="overflow-y:scroll;">
           <a-tree
             v-model="checkedKeys"
             checkable
+            id="chooseAreaModal-tree"
             :auto-expand-parent="autoExpandParent"
             :tree-data="subregionData"
             :checkStrictly="true"
@@ -27,8 +28,8 @@
         </div>
       </div>
       <div class="areaFooter">
-        <a-button style="margin-right: 15px" @click="visible = false" :disabled="disabled" id="areaSet-reset">取消</a-button>
-        <a-button type="primary" @click="save" :disabled="disabled" id="areaSet-refresh">保存</a-button>
+        <a-button style="margin-right: 15px" @click="visible = false" :disabled="disabled" id="chooseAreaModal-close">取消</a-button>
+        <a-button type="primary" @click="save" :disabled="disabled" id="chooseAreaModal-save">保存</a-button>
       </div>
     </div>
   </a-drawer>
@@ -36,6 +37,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 接口
 import { subareaQueryAll } from '@/api/subarea'
 export default {
   mixins: [commonMixin],
@@ -65,16 +67,18 @@ export default {
   },
   data () {
     return {
-      autoExpandParent: true,
+      autoExpandParent: true, // 是否展开子级数据
       checkAll: false, //  全选
+      // 选中数据
       checkedKeys: {
-        checked: [], halfChecked: []
+        checked: [],
+        halfChecked: []
       },
-      subregionData: null,
-      tableHeight: 0,
-      visible: false,
-      disabled: false,
-      parentArr: []
+      subregionData: null, // 树数据
+      tableHeight: 0, // 表格高度
+      visible: false, // 是否打开弹窗
+      disabled: false, // 取消、保存按钮禁用状态
+      parentArr: []// 父级展开数据
     }
   },
   methods: {
@@ -84,6 +88,7 @@ export default {
       this.parentArr = expandedKeys
       this.autoExpandParent = false
     },
+    // 获取区域数据
     getArea () {
       subareaQueryAll().then(res => {
         if (res.status == 200) {
@@ -106,7 +111,7 @@ export default {
         }
       })
     },
-
+    // 保存
     save () {
       this.$emit('ok', this.checkedKeys)
     },
@@ -133,9 +138,11 @@ export default {
         })
       }
     },
+    // 选中  check
     onCheck (checkedKeys) {
       this.checkedKeys = checkedKeys
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -143,6 +150,7 @@ export default {
       })
       this.getArea()
     },
+    // 计算表格高度
     setTableH () {
       this.tableHeight = window.innerHeight - 325
     }

+ 43 - 28
src/views/dealerManagement/businessOwnerSettings/chooseDealer.vue

@@ -15,9 +15,9 @@
             </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24">
-            <a-form-model-item label="商户级别" prop="dealerLevel">
-              <v-select code="DEALER_LEVEL" id="ucModal-dealerLevel" v-model="queryParam.dealer.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
-            </a-form-model-item>
+            <a-form-item label="商户级别" prop="dealerLevel">
+              <v-select code="DEALER_LEVEL" id="chooseDealer-dealerLevel" v-model="queryParam.dealer.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
+            </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24" v-if="pageType!='viewDealers'">
             <a-form-item label="所在区域/分区">
@@ -27,13 +27,13 @@
           <div v-else>
             <a-col :md="8" :sm="24">
               <a-form-item label="审核状态">
-                <v-select code="AUDIT_STATE" id="viewDealers-auditState" v-model="queryParam.auditState" allowClear placeholder="请选择审核状态"></v-select>
+                <v-select code="AUDIT_STATE" id="chooseDealer-auditState" v-model="queryParam.auditState" allowClear placeholder="请选择审核状态"></v-select>
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
-              <a-form-model-item label="地区">
-                <AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-              </a-form-model-item>
+              <a-form-item label="地区">
+                <AreaList id="chooseDealer-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+              </a-form-item>
             </a-col>
           </div>
           <a-col :md="pageType!='viewDealers'?8:6" :sm="24" style="margin-bottom: 10px;">
@@ -42,14 +42,15 @@
           </a-col>
         </a-row>
       </a-form>
-      <!-- 列表 -->
+      <!-- 操作按钮 -->
       <div style="margin-bottom: 10px">
-        <a-button type="primary" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
+        <a-button type="primary" id="chooseDealer-add" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
         <span style="margin-left: 5px">
           <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template>
         </span>
       </div>
     </div>
+    <!-- 列表 -->
     <s-table
       class="sTable"
       ref="table"
@@ -75,7 +76,7 @@
           class="button-error"
           @click="handleAdd(record)"
           v-if="record.subareaAreaSn != parentData.subareaAreaSn"
-          id="marketingDivisionSetNew-del-btn">添加</a-button>
+          :id="'chooseDealer-add-btn'+record.dealerSn">添加</a-button>
         <span style="color:#666" v-else>已添加</span>
       </template>
     </s-table>
@@ -84,11 +85,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import AreaList from '@/views/common/areaList.js'
-import { bizuserScopeQueryDealer } from '@/api/bizuser'
 import subarea from '@/views/common/subarea.js'
 import dealerType from '@/views/common/dealerType.js'
+// 接口
+import { bizuserScopeQueryDealer } from '@/api/bizuser'
 export default {
   name: 'ChooseDealer',
   mixins: [commonMixin],
@@ -108,36 +111,39 @@ export default {
   data () {
     return {
       spinning: false,
-      dealerType: [],
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, // 批量添加loading
+      dealerType: [], // 商户类型
+      //  查询条件
+      queryParam: {
         dealer: {
-          nameLike: '',
+          nameLike: '', // 经销商名称/别名
           dealerType1: undefined, //  商户类型
           dealerType2: undefined, //  商户类型
           dealerLevel: null
         },
-        auditState: undefined,
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
-        subareaSn: undefined,
-        subareaAreaSn: undefined
+        auditState: undefined, // 审核状态
+        provinceSn: undefined, // 省sn
+        citySn: undefined, // 市sn
+        districtSn: undefined, // 区sn
+        subareaSn: undefined, // 区域
+        subareaAreaSn: undefined// 分区
       },
-      userSn: '',
-      pageFlag: false,
-      chooseInfo: [],
-      tableHeight: 0,
-      disabled: false, //  查询、重置按钮是否可操作
-      loading: false, // 批量添加loading
+      userSn: '', // 用户sn
+      pageFlag: false, // 是否显示选择框
+      chooseInfo: [], // 选中数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
         this.queryParam.userSn = this.userSn
+        // 获取列表数据  有分页
         return bizuserScopeQueryDealer(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           const _this = this
           if (res.status == 200) {
             data = res.data
+            // 计算列表序号
             const no = 0
             const chooseData = []
             for (var i = 0; i < data.list.length; i++) {
@@ -163,7 +169,7 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null
+      rowSelectionInfo: null// 选中数据
     }
   },
   computed: {
@@ -185,6 +191,7 @@ export default {
       }
       return arr
     },
+    // 计算选中数据条数
     selectCount () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
     }
@@ -194,19 +201,23 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
+    // 商户类型 change
     getDealerType (v, o) {
       this.queryParam.dealer.dealerType1 = v[0]
       this.queryParam.dealer.dealerType2 = v[1]
     },
+    // 地区 change
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
+    // 查询
     searchForm (flag) {
       this.$refs.table.refresh(flag)
       this.spinning = false
     },
+    // 区域分区
     subareaChange (val) {
       this.queryParam.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
@@ -219,7 +230,7 @@ export default {
           nameLike: '',
           dealerType1: undefined, //  商户类型
           dealerType2: undefined, //  商户类型
-          dealerLevel: null
+          dealerLevel: null// 商户级别
         },
         auditState: undefined,
         provinceSn: undefined,
@@ -237,6 +248,7 @@ export default {
       this.$refs.table.refresh(true)
       this.pageFlag = false
     },
+    // 清除表格内容
     clearTable () {
       this.rowSelectionInfo = null
       this.$refs.table.clearTable()
@@ -252,6 +264,7 @@ export default {
       this.spinning = false
       this.$emit('plAdd', dealerSnList)
     },
+    // 添加
     handleAdd (row) {
       if (row.subareaArea) {
         const _this = this
@@ -269,6 +282,7 @@ export default {
         this.$emit('add', row)
       }
     },
+    // 初始化
     pageInit (data) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -278,6 +292,7 @@ export default {
       this.userSn = data.sn
       this.resetSearchForm()
     },
+    // 计算表格数据
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 285

+ 27 - 13
src/views/dealerManagement/businessOwnerSettings/chooseSupplier.vue

@@ -2,7 +2,7 @@
   <a-spin :spinning="spinning" tip="Loading...">
     <!-- 搜索条件 -->
     <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form layout="inline" id="chooseSupplier-form" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="8" :sm="24">
             <a-form-item label="供应商名称">
@@ -15,14 +15,15 @@
           </a-col>
         </a-row>
       </a-form>
-      <!-- 列表 -->
+      <!-- 操作按钮 -->
       <div style="margin-bottom: 10px">
-        <a-button type="primary" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
+        <a-button type="primary" ghost :loading="loading" id="chooseSupplier-add" @click="handleBatchAudit">批量添加</a-button>
         <span style="margin-left: 5px">
           <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template>
         </span>
       </div>
     </div>
+    <!-- 列表 -->
     <s-table
       class="sTable"
       ref="table"
@@ -43,10 +44,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import AreaList from '@/views/common/areaList.js'
-import { querySupplierPage } from '@/api/bizuser'
 import subarea from '@/views/common/subarea.js'
+// 接口
+import { querySupplierPage } from '@/api/bizuser'
 export default {
   name: 'ChooseSupplier',
   mixins: [commonMixin],
@@ -54,26 +57,29 @@ export default {
   data () {
     return {
       spinning: false,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, // 批量添加loading
+      //  查询条件
+      queryParam: {
         supplier: {
-          supplierName: ''
+          supplierName: ''// 供应商名称
         }
       },
-      userSn: '',
-      pageFlag: false,
-      chooseInfo: [],
-      tableHeight: 0,
-      disabled: false, //  查询、重置按钮是否可操作
-      loading: false, // 批量添加loading
+      userSn: '', // 用户sn
+      pageFlag: false, // 是否显示选择框
+      chooseInfo: [], // 选中数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
         this.queryParam.userSn = this.userSn
+        // 获取列表数据  有分页
         return querySupplierPage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           const _this = this
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = 0
             const chooseData = []
             for (var i = 0; i < data.list.length; i++) {
@@ -96,7 +102,7 @@ export default {
           return data
         })
       },
-      rowSelectionInfo: null
+      rowSelectionInfo: null// 列表选择数据
     }
   },
   computed: {
@@ -109,6 +115,7 @@ export default {
       ]
       return arr
     },
+    // 计算列表选中数据条数
     selectCount () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
     }
@@ -118,15 +125,18 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
+    // 地区
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
+    // 查询
     searchForm (flag) {
       this.$refs.table.refresh(flag)
       this.spinning = false
     },
+    // 区域分区
     subareaChange (val) {
       this.queryParam.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
@@ -142,6 +152,7 @@ export default {
       this.$refs.table.refresh(true)
       this.pageFlag = false
     },
+    // 清除表格内容
     clearTable () {
       this.rowSelectionInfo = null
       this.$refs.table.clearTable()
@@ -157,6 +168,7 @@ export default {
       this.spinning = false
       this.$emit('plAdd', supplierSnList)
     },
+    // 添加
     handleAdd (row) {
       if (row.subareaArea) {
         const _this = this
@@ -174,6 +186,7 @@ export default {
         this.$emit('add', row)
       }
     },
+    // 初始化
     pageInit (data) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -184,6 +197,7 @@ export default {
       this.resetSearchForm()
       this.pageFlag = false
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 300

+ 26 - 14
src/views/dealerManagement/businessOwnerSettings/list.vue

@@ -3,10 +3,10 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="businessOwnerSettings-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="人员类型">
+              <a-form-item label="人员类型">
                 <v-select
                   v-model="queryParam.bizUserType"
                   ref="printStatus"
@@ -14,7 +14,7 @@
                   code="BIZ_USER_TYPE"
                   placeholder="请选择人员类型"
                   allowClear></v-select>
-              </a-form-model-item>
+              </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="人员姓名">
@@ -29,6 +29,7 @@
         </a-form>
       </div>
     </a-card>
+    <!-- 操作按钮 -->
     <a-card size="small" :bordered="false" class="dealerZoneSearch-wrap">
       <a-spin :spinning="spinning" tip="Loading...">
         <div class="table-operator">
@@ -64,9 +65,15 @@
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button size="small" type="link" class="button-warning" v-if="record.allDealerFlag!=1 || record.allProductFlag!=1 ||record.allSupplierFlag&&record.allSupplierFlag!=1" @click="handleSetCategory(record)">设置管辖范围</a-button>
-            <a-button size="small" type="link" class="button-info" @click="handleEdit(record)">编辑</a-button>
-            <a-button size="small" type="link" class="button-error" @click="handleDelete(record)">删除</a-button>
+            <a-button
+              size="small"
+              type="link"
+              :id="'businessOwnerSettings-set-btn'+record.id"
+              class="button-warning"
+              v-if="record.allDealerFlag!=1 || record.allProductFlag!=1 ||record.allSupplierFlag&&record.allSupplierFlag!=1"
+              @click="handleSetCategory(record)">设置管辖范围</a-button>
+            <a-button size="small" type="link" :id="'businessOwnerSettings-edit-btn'+record.id" class="button-info" @click="handleEdit(record)">编辑</a-button>
+            <a-button size="small" type="link" :id="'businessOwnerSettings-del-btn'+record.id" class="button-error" @click="handleDelete(record)">删除</a-button>
           </template>
         </s-table>
       </a-spin>
@@ -78,9 +85,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
-import { queryPage, bizuserDelete } from '@/api/bizuser'
 import addModal from './addModal'
+// 接口
+import { queryPage, bizuserDelete } from '@/api/bizuser'
 export default {
   name: 'BusinessOwnerSettings',
   mixins: [commonMixin],
@@ -89,10 +98,11 @@ export default {
     return {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      // 查询参数
       queryParam: {
-        bizUserType: '',
-        userName: undefined
+        bizUserType: '', // 人员类型
+        userName: undefined// 人员姓名
       },
       columns: [
         { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -108,9 +118,11 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据  有分页
         return queryPage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           data = res.data
+          // 计算列表序号
           const no = (data.pageNo - 1) * data.pageSize
           this.total = data.count || 0
           for (var i = 0; i < data.list.length; i++) {
@@ -122,13 +134,11 @@ export default {
         })
       },
       openAddModal: false, //  编辑  弹框
-      itemId: ''
+      itemId: ''// 当前id
     }
   },
   methods: {
-    userChange (val) {
-      this.queryParam.userSn = val.key
-    },
+    // 设置管辖范围
     handleSetCategory (row) {
       this.$router.push({ name: 'categorySet', query: { sn: row.userSn, id: row.id } })
     },
@@ -181,6 +191,7 @@ export default {
       this.itemId = ''
       this.openAddModal = false
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -188,6 +199,7 @@ export default {
       })
       this.resetSearchForm()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240

+ 37 - 29
src/views/dealerManagement/businessOwnerSettings/settingsIndex.vue

@@ -12,31 +12,32 @@
       </div>
       <a-card size="small" :bordered="false" class="categorySet-cont">
         <div>
-          <a-tabs v-model="activeKeyVal" @change="handleTabs">
+          <a-tabs v-model="activeKeyVal" @change="handleTabs" id="settingsIndex-tabs">
             <a-tab-pane key="1" tab="设置管辖区域" v-if="infoObj.allDealerFlag && infoObj.allDealerFlag!=1">
               <div class="areaSet-wrap">
                 <div class="table-page-search-wrapper newTableSearchName" >
-                  <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+                  <a-form layout="inline" id="settingsIndex-form" @keyup.enter.native="$refs.table.refresh(true)">
                     <a-row :gutter="15">
                       <a-col :md="6" :sm="24">
-                        <a-form-model-item label="所在区域/分区">
-                          <subarea id="chooseDealer-subarea" ref="subarea" @change="subareaChange"></subarea>
-                        </a-form-model-item>
+                        <a-form-item label="所在区域/分区">
+                          <subarea id="settingsIndex-subarea" ref="subarea" @change="subareaChange"></subarea>
+                        </a-form-item>
                       </a-col>
                       <a-col :md="6" :sm="24">
                         <a-form-item label="经销商名称">
-                          <a-input id="areaSet-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
+                          <a-input id="settingsIndex-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
                         </a-form-item>
                       </a-col>
                       <a-col :md="6" :sm="24">
-                        <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="areaSet-refresh">查询</a-button>
-                        <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="areaSet-reset">重置</a-button>
+                        <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="settingsIndex-refresh">查询</a-button>
+                        <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="settingsIndex-reset">重置</a-button>
                       </a-col>
                     </a-row>
                   </a-form>
+                  <!-- 操作按钮 -->
                   <div class="areaSet-btnGroup" style="margin-bottom:10px;">
-                    <a-button type="primary" class="button-info" @click="openAreaModal">选择区域</a-button>
-                    <a-button type="primary" class="button-error" @click="openDealerModal">选择经销商</a-button>
+                    <a-button type="primary" id="settingsIndex-addArea" class="button-info" @click="openAreaModal">选择区域</a-button>
+                    <a-button type="primary" id="settingsIndex-addDealer" class="button-error" @click="openDealerModal">选择经销商</a-button>
                   </div>
                 </div>
                 <a-spin :spinning="spinning" tip="Loading...">
@@ -45,8 +46,7 @@
                     class="sTable fixPagination"
                     ref="table"
                     size="small"
-                    :rowKey="(record) => record.no"
-                    rowKeyName="no"
+                    :rowKey="(record) => record.id"
                     :columns="columns"
                     :data="loadData"
                     :defaultLoadData="false"
@@ -59,10 +59,8 @@
                         size="small"
                         type="link"
                         class="button-error"
-                        @click="handleDel(record)"
-                      >
-                        删除
-                      </a-button>
+                        :id="'settingsIndex-del-btn'+record.id"
+                        @click="handleDel(record)">删除</a-button>
                     </template>
                   </s-table>
                 </a-spin>
@@ -103,32 +101,36 @@
 </template>
 
 <script>
-import { commonMixin } from '@/utils/mixin'
+import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable } from '@/components'
 import categorySet from './categorySet'
 import supplierSet from './supplierSet'
 import chooseAreaModal from './chooseAreaModal'
 import chooseDealer from './chooseDealer.vue'
-import { queryDealerScopePage, bizuserScopeDelete, findById, queryAreaScope, queryDealerScope, saveAreaScope, saveDealerScope } from '@/api/bizuser'
-import subarea from '@/views/common/subarea.js'
+import subarea from '@/views/common/subarea.js'
+// 接口
+import { queryDealerScopePage, bizuserScopeDelete, findById, queryAreaScope, queryDealerScope, saveAreaScope, saveDealerScope } from '@/api/bizuser'
 export default {
   name: 'SettingsIndex',
   mixins: [commonMixin],
   components: { STable, categorySet, chooseAreaModal, chooseDealer, subarea, supplierSet },
   data () {
     return {
-      openChooseArea: false,
-      openChooseDealer: false,
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      openChooseArea: false, // 打开选择区域弹窗
+      openChooseDealer: false, // 打开选择经销商弹窗
+      // 查询参数
       queryParam: {
         hasDetail: 0,
-        bizType: undefined,
-        bizSn: undefined,
-        dealerName: ''
+        bizType: undefined, // 区域分区区别
+        bizSn: undefined, // 当前行sn
+        dealerName: ''// 经销商
       },
-      activeKeyVal: '1',
-      infoObj: {},
+      activeKeyVal: '1', // 选项卡值  1设置管辖区域 2设置管辖品类 3设置供应商
+      infoObj: {}, // 基本信息数据
       newChooseData: {// 区域分区回显
         checked: [],
         halfChecked: []
@@ -140,17 +142,18 @@ export default {
         { title: '分区', dataIndex: 'subareaAreaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '经销商', dataIndex: 'dealerName', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
-      disabled: false, //  查询、重置按钮是否可操作
+      ],
       chooseInfo: [], // 回显选中经销商信息
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         this.queryParam.userSn = this.$route.query.sn
+        // 获取列表数据  有分页
         return queryDealerScopePage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             this.total = data.count || 0
             for (var i = 0; i < data.list.length; i++) {
@@ -210,6 +213,7 @@ export default {
       })
       this.saveChooseArea(newData)
     },
+    // 保存区域分区数据
     saveChooseArea (list) {
       const _this = this
       const newAjaxData = {}
@@ -222,6 +226,7 @@ export default {
         }
       })
     },
+    // tabs 选择
     handleTabs (val) {
       this.activeKeyVal = val
       if (val == 2) {
@@ -243,6 +248,7 @@ export default {
         this.queryParam.bizType = undefined
       }
     },
+    // 重置
     resetSearchForm () {
       this.queryParam = {
         bizSn: undefined,
@@ -337,6 +343,7 @@ export default {
     handleBack () {
       this.$router.push({ name: 'businessOwnerSettings' })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -344,6 +351,7 @@ export default {
       })
       _this.getBaseInfo()
     },
+    // 计算列表高度
     setTableH () {
       const headHeight = this.$refs.headerBar.offsetHeight
       this.tableHeight = window.innerHeight - headHeight - 340

+ 68 - 67
src/views/dealerManagement/businessOwnerSettings/supplierSet.vue

@@ -1,47 +1,49 @@
 <template>
-  <div class="categorySet-wrap">
+  <div class="supplierSet-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
-        <div class="areaSet-wrap">
-          <div class="table-page-search-wrapper flex-center" style="width:100%;justify-content: space-between;margin-bottom:10px">
-            <div class="areaSet-btnGroup">
-              <a-button type="primary" @click="openSupplierModal">新增</a-button>
-            </div>
-            <div>
-              <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-                <a-input style="width:300px;" id="areaSet-dealerName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商名称"/>
-                <a-button style="margin-left: 15px" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="areaSet-refresh">查询</a-button>
-                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="areaSet-reset">重置</a-button>
-              </a-form>
-            </div>
-          </div>
-          <a-spin :spinning="spinning" tip="Loading...">
-            <!-- 列表 -->
-            <s-table
-              class="sTable fixPagination"
-              ref="table"
-              size="small"
-              :rowKey="(record) => record.no"
-              rowKeyName="no"
-              :columns="columns"
-              :data="loadData"
-              :defaultLoadData="false"
-              :style="{ height: tableHeight + 70 +'px' }"
-              :scroll="{ y: tableHeight }"
-              bordered>
-              <!-- 操作 -->
-              <template slot="action" slot-scope="text, record">
-                <a-button
-                  size="small"
-                  type="link"
-                  class="button-error"
-                  @click="handleDel(record)"
-                >
-                  删除
-                </a-button>
-              </template>
-            </s-table>
-          </a-spin>
+      <div class="supplierSetCon-wrap">
+        <!-- 操作按钮 -->
+        <div class="table-page-search-wrapper flex-center" style="width:100%;justify-content: space-between;margin-bottom:10px">
+          <div class="supplierSet-btnGroup">
+            <a-button type="primary" id="supplierSet-add" @click="openSupplierModal">新增</a-button>
+          </div>
+          <!-- 搜索条件 -->
+          <div>
+            <a-form layout="inline" id="supplierSet-form" @keyup.enter.native="$refs.table.refresh(true)">
+              <a-input style="width:300px;" id="supplierSet-dealerName" v-model.trim="queryParam.supplierName" allowClear placeholder="请输入供应商名称"/>
+              <a-button style="margin-left: 15px" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="supplierSet-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="supplierSet-reset">重置</a-button>
+            </a-form>
+          </div>
         </div>
+        <a-spin :spinning="spinning" tip="Loading...">
+          <!-- 列表 -->
+          <s-table
+            class="sTable fixPagination"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.id"
+            :columns="columns"
+            :data="loadData"
+            :defaultLoadData="false"
+            :style="{ height: tableHeight + 70 +'px' }"
+            :scroll="{ y: tableHeight }"
+            bordered>
+            <!-- 操作 -->
+            <template slot="action" slot-scope="text, record">
+              <a-button
+                size="small"
+                type="link"
+                :id="'supplierSet-del-btn'+record.id"
+                class="button-error"
+                @click="handleDel(record)"
+              >
+                删除
+              </a-button>
+            </template>
+          </s-table>
+        </a-spin>
+      </div>
     </a-spin>
     <!-- 选择供应商 -->
     <a-drawer
@@ -60,15 +62,16 @@
 </template>
 
 <script>
-import { commonMixin } from '@/utils/mixin'
-import chooseSupplier from './chooseSupplier.vue'
-import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
+import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable } from '@/components'
+import chooseSupplier from './chooseSupplier.vue'
+// 接口
 import { querySupplierScopePage, querySupplierScope, saveSupplierList, bizuserScopeDelete } from '@/api/bizuser'
 export default {
-  name: 'CategorySet',
+  name: 'SupplierSet',
   mixins: [commonMixin],
-  components: { chooseSupplier, ChooseTypeModal, STable },
+  components: { chooseSupplier, STable },
   props: {
     bizUserSn: {
       type: String,
@@ -78,7 +81,7 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -88,29 +91,23 @@ export default {
         // { title: '联系手机', dataIndex: 'subareaAreaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
-      openChooseSupplier: false,
+      openChooseSupplier: false, // 选择供应商弹窗
+      // 查询参数
       queryParam: {
-        supplierName: ''
+        supplierName: ''// 供应商名称
       },
-      dataSource: [],
-      openModal: false, //  新增编辑产品品牌  弹框
-      itemSn: '', //  当前sn
-      nowData: null, //  当前记录数据
-      openBrandModal: false,
-      openChooseDealer: true,
-      openTypeModal: false,
-      chooseBrand: [],
-      chooseType: [],
-      chooseObj: null, // 选择品牌 内容
+      dataSource: [], // 列表数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // this.spinning = true
+        this.spinning = true
         this.queryParam.userSn = this.$route.query.sn
-        this.queryParam.bizUserSn = this.bizUserSn
+        this.queryParam.bizUserSn = this.bizUserSn
+        // 获取列表数据  有分页
         return querySupplierScopePage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
-          data = res.data
+          data = res.data
+          // 计算列表序号
           const no = (data.pageNo - 1) * data.pageSize
           this.total = data.count || 0
           for (var i = 0; i < data.list.length; i++) {
@@ -118,7 +115,7 @@ export default {
           }
           this.dataSource = data.list
           this.disabled = false
-          // this.spinning = false
+          this.spinning = false
           return data
         })
       }
@@ -153,6 +150,7 @@ export default {
         obj.userSn = this.$route.query.sn
         obj.bizUserSn = this.bizUserSn
        obj.bizType = 'supplier'
        obj.bizSn = con
        newData.push(obj)
      })
      this.saveChooseDealer(newData)
     },
+    // 保存所选供应商
     saveChooseDealer (list) {
       const _this = this
       const ajaxData = {}
@@ -181,19 +179,22 @@ export default {
         }
       })
     },
+    // 重置
     resetSearchForm () {
       this.queryParam = {
         supplierName: ''
       }
       this.$refs.table.refresh(true)
-    },
+    },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
       this.$refs.table.refresh()
-    },
+    },
+    // 计算表格高度
     setTableH () {
       this.tableHeight = window.innerHeight - 345
     }
@@ -210,7 +211,7 @@ export default {
 </script>
 
 <style lang="less">
-  .categorySet-wrap{
-    
+  .supplierSet-wrap{
+
   }
 </style>

+ 1 - 0
src/views/dealerManagement/dealerAccountManagement/detailModal.vue

@@ -22,6 +22,7 @@
 </template>
 
 <script>
+// 接口
 import { dealerUserDetail } from '@/api/dealer'
 export default {
   name: 'DealerAccountDetailModal',

+ 26 - 16
src/views/dealerManagement/dealerAccountManagement/editModal.vue

@@ -79,7 +79,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import custList from '@/views/common/custList.vue'
+// 接口
 import { dealerUserSave, dealerUserDetail } from '@/api/dealer'
 export default {
   name: 'DealerAccountEditModal',
@@ -99,20 +101,23 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      // form表单label布局
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
+      // 提交数据
       form: {
-        tenantSn: '',
-        name: '',
-        phone: '',
-        loginName: '',
-        password: '',
+        tenantSn: '', // 经销商sn
+        name: '', // 管理员姓名
+        phone: '', // 管理员手机
+        loginName: '', // 管理员账号
+        password: '', // 管理员密码
         org: {
-          childUserMaxNum: ''
+          childUserMaxNum: ''// 最大可开通用户数
         }
       },
+      // 表单验证规则
       rules: {
         tenantSn: [{ required: true, message: '请选择经销商', trigger: 'change' }],
         name: [{ required: true, message: '请输入管理员姓名', trigger: 'blur' }],
@@ -151,6 +156,7 @@ export default {
         }
       }
     },
+    // 经销商名称 change
     custChange (val) {
       this.form.tenantSn = val.key
     },
@@ -197,6 +203,19 @@ export default {
           this.$refs.ruleForm.resetFields()
         }
       })
+    },
+    // 重置
+    resetSearchForm () {
+      this.$refs.ruleForm.resetFields()
+      this.form.tenantSn = ''
+      this.form.name = ''
+      this.form.phone = ''
+      this.form.loginName = ''
+      this.form.password = ''
+      this.form.org.childUserMaxNum = ''
+      if (this.itemId == '') {
+        this.$refs.custList.resetForm()
+      }
     }
   },
   watch: {
@@ -219,16 +238,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.$refs.ruleForm.resetFields()
-        this.form.tenantSn = ''
-        this.form.name = ''
-        this.form.phone = ''
-        this.form.loginName = ''
-        this.form.password = ''
-        this.form.org.childUserMaxNum = ''
-        if (this.itemId == '') {
-          this.$refs.custList.resetForm()
-        }
+        this.resetSearchForm()
       }
     },
     itemId (newValue, oldValue) {

+ 16 - 12
src/views/dealerManagement/dealerAccountManagement/list.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="dealerAccountList-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="dealerAccountList-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="经销商名称">
@@ -50,7 +50,7 @@
           <!-- 账号状态 -->
           <template slot="loginFlag" slot-scope="text, record">
             <a-switch
-              id="dealerAccountList-enable"
+              :id="'dealerAccountList-enable'+record.id"
               v-if="$hasPermissions('B_dealerAccount_enable')"
               checkedChildren="启用"
               unCheckedChildren="禁用"
@@ -66,21 +66,21 @@
               v-if="$hasPermissions('B_dealerAccount_edit')"
               class="button-info"
               @click="handleEdit(record)"
-              id="dealerAccountList-edit-btn">编辑</a-button>
+              :id="'dealerAccountList-edit-btn'+record.id">编辑</a-button>
             <a-button
               size="small"
               type="link"
               v-if="$hasPermissions('B_dealerAccount_detail')"
               class="button-success"
               @click="handleDetail(record)"
-              id="dealerAccountList-detail-btn">详情</a-button>
+              :id="'dealerAccountList-detail-btn'+record.id">详情</a-button>
             <a-button
               size="small"
               type="link"
               v-if="$hasPermissions('B_dealerAccount_reset')"
               class="button-warning"
               @click="handleReset(record)"
-              id="dealerAccountList-reset-btn">重置密码</a-button>
+              :id="'dealerAccountList-reset-btn'+record.id">重置密码</a-button>
             <span v-if="!$hasPermissions('B_dealerAccount_edit') && !$hasPermissions('B_dealerAccount_detail') && !$hasPermissions('B_dealerAccount_reset')">--</span>
           </template>
         </s-table>
@@ -101,9 +101,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import dealerAccountEditModal from './editModal.vue'
 import dealerAccountDetailModal from './detailModal.vue'
+// 接口
 import { dealerUserList, dealerUserEnable, dealerUserResetP } from '@/api/dealer'
 export default {
   name: 'DealerAccountManagementList',
@@ -112,15 +114,15 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
       queryParam: { //  查询条件
         org: {
-          name: ''
+          name: ''// 经销商名称
         },
-        loginName: '',
-        loginFlag: undefined
+        loginName: '', // 管理员账号
+        loginFlag: undefined// 状态
       },
-      disabled: false, //  查询、重置按钮是否可操作
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center' },
@@ -139,6 +141,7 @@ export default {
           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
@@ -153,8 +156,7 @@ export default {
       openModal: false, //  新增编辑  弹框
       openDetailModal: false, // 详情  弹框
       itemId: '', //  当前id
-      nowData: null, //  当前记录数据
-      productBrandList: []
+      nowData: null //  当前记录数据
     }
   },
   methods: {
@@ -226,12 +228,14 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240

+ 23 - 21
src/views/dealerManagement/dealerZoneSearch/list.vue

@@ -6,9 +6,9 @@
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="所属区域/分区">
+              <a-form-item label="所属区域/分区">
                 <subarea id="dealerZoneSearch-subareaSn" ref="subarea" @change="subareaChange"></subarea>
-              </a-form-model-item>
+              </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="经销商">
@@ -17,7 +17,7 @@
             </a-col>
             <a-col :md="7" :sm="24">
               <a-form-item label="客服/区域负责人/销售总监">
-                <a-input id="dealerZoneSearch-dealerName" v-model.trim="queryParam.bizUserName" allowClear placeholder="请输入客服/区域负责人/销售总监"/>
+                <a-input id="dealerZoneSearch-bizUserName" v-model.trim="queryParam.bizUserName" allowClear placeholder="请输入客服/区域负责人/销售总监"/>
               </a-form-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -43,8 +43,7 @@
           ref="table"
           :style="{ height: tableHeight+70+'px' }"
           size="small"
-          :rowKey="(record) => record.no"
-          rowKeyName="no"
+          :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
           :pageSize="30"
@@ -52,7 +51,7 @@
           :defaultLoadData="false"
           bordered>
           <template slot="kf" slot-scope="text, record">
-            <a-tooltip placement="top" v-if="record.userNameKfs">
+            <a-tooltip placement="top" :id="'dealerZoneSearch-userNameKfs'+record.id" v-if="record.userNameKfs">
               <template slot="title">
                 {{ record.userNameKfs }}
               </template>
@@ -61,7 +60,7 @@
             <span v-else>--</span>
           </template>
           <template slot="qyfzr" slot-scope="text, record">
-            <a-tooltip placement="top" v-if="record.userNameQyfzrs">
+            <a-tooltip placement="top" :id="'dealerZoneSearch-userNameQyfzrs'+record.id" v-if="record.userNameQyfzrs">
               <template slot="title">
                 {{ record.userNameQyfzrs }}
               </template>
@@ -70,7 +69,7 @@
             <span v-else>--</span>
           </template>
           <template slot="xszj" slot-scope="text, record">
-            <a-tooltip placement="top" v-if="record.userNameXszjs">
+            <a-tooltip placement="top" :id="'dealerZoneSearch-userNameXszjs'+record.id" v-if="record.userNameXszjs">
               <template slot="title">
                 {{ record.userNameXszjs }}
               </template>
@@ -86,11 +85,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { exportExcel } from '@/libs/JGPrint.js'
+// 组件
 import { STable } from '@/components'
 import subarea from '@/views/common/subarea.js'
-import { exportExcel } from '@/libs/JGPrint.js'
-import { queryDealerWithBizuser, exportDealerWithBizuser } from '@/api/dealerRelation'
 import custList from '@/views/common/custList.vue'
+// 接口
+import { queryDealerWithBizuser, exportDealerWithBizuser } from '@/api/dealerRelation'
 export default {
   name: 'DealerZoneSearch',
   mixins: [commonMixin],
@@ -99,17 +100,18 @@ export default {
     return {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      exportLoading: false, // 导出loading
+      // 查询条件
       queryParam: {
-        subareaSn: undefined,
-        subareaAreaSn: undefined,
+        subareaSn: undefined, // 区域
+        subareaAreaSn: undefined, // 分区
         dealer: {
-          dealerSn: '',
-          dealerName: ''
+          dealerSn: '', // 经销商sn
+          dealerName: ''// 经销商名称
         },
-        bizUserName: ''
+        bizUserName: ''// 客服/区域负责人/销售总监
       },
-      exportLoading: false, // 导出loading
       columns: [
         { title: '经销商名称', dataIndex: 'dealer.dealerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '所属区域', dataIndex: 'subareaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -122,14 +124,11 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        // 获取列表数据 有分页
         return queryDealerWithBizuser(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            const no = 0
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
-            }
             this.disabled = false
           }
           this.spinning = false
@@ -150,6 +149,7 @@ export default {
         _this.exportLoading = false
       })
     },
+    // 区域分区
     subareaChange (val) {
       this.queryParam.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
@@ -170,6 +170,7 @@ export default {
       this.queryParam.dealer.dealerSn = val.key
       this.queryParam.dealer.dealerName = val.key ? (val.label.replace('\n', '')).trim() : ''
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -177,6 +178,7 @@ export default {
       })
       this.$refs.table.refresh()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200

+ 13 - 7
src/views/dealerManagement/marketingDivisionSetNew/addAreaModal.vue

@@ -39,10 +39,10 @@
 </template>
 
 <script>
+// 接口
 import { subareaSaveSubarea, subareaQuerySubarea } from '@/api/subarea'
 export default {
   name: 'MarketingDivisionSetEditModal',
-  components: { },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -54,21 +54,25 @@ export default {
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       return (this.itemId ? '编辑' : '新增') + '区域'
     }
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // 表单label布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      // 提交数据
       form: {
         subareaName: '' // 区域名称
       },
+      // 表单验证规则
       rules: {
         subareaName: [
           { required: true, message: '请输入区域名称', trigger: 'blur' }
@@ -77,6 +81,7 @@ export default {
     }
   },
   methods: {
+    // 区域名称
     filterEmpty () {
       let str = this.form.subareaName
       str = str.replace(/\ +/g, '')
@@ -84,10 +89,11 @@ export default {
       str = str.replace(/[\r\n]/g, '')
       this.form.subareaName = str
     },
-    getDetail(){
+    // 获取详情数据
+    getDetail () {
       this.spinning = true
-      subareaQuerySubarea({subareaSn: this.itemId}).then(res=>{
-        if(res.status == 200){
+      subareaQuerySubarea({ subareaSn: this.itemId }).then(res => {
+        if (res.status == 200) {
           this.form.subareaName = res.data[0].subareaName
         }
         this.spinning = false
@@ -131,8 +137,8 @@ export default {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
         this.form.subareaName = ''
-      }else{
-        if(this.itemId){
+      } else {
+        if (this.itemId) {
           this.getDetail()
         }
       }

+ 16 - 9
src/views/dealerManagement/marketingDivisionSetNew/addZoneModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="marketingDivisionSetEdit-modal"
+    class="addZone-modal"
     :footer="null"
     :maskClosable="false"
     :title="modalTit"
@@ -13,6 +13,7 @@
       ref="ruleForm"
       :model="form"
       :rules="zoneRules"
+      id="addZone-modal-form"
       :label-col="formItemLayout.labelCol"
       :wrapper-col="formItemLayout.wrapperCol"
     >
@@ -21,6 +22,7 @@
       </a-form-model-item>
       <a-form-model-item label="分区名称" prop="subareaAreaName">
         <a-input
+          id="addZone-modal-subareaAreaName"
           :maxLength="30"
           v-model.trim="form.subareaAreaName"
           @change="filterEmpty"
@@ -29,16 +31,16 @@
       </a-form-model-item>
     </a-form-model>
     <div class="btn-cont">
-      <a-button id="marketingDivisionSetEdit-modal-back" @click="isShow = false" >取消</a-button>
-      <a-button type="primary" style="margin-left: 15px;" id="marketingDivisionSetEdit-modal-save" @click="handleSave">保存</a-button>
+      <a-button id="addZone-modal-back" @click="isShow = false" >取消</a-button>
+      <a-button type="primary" style="margin-left: 15px;" id="addZone-modal-save" @click="handleSave">保存</a-button>
     </div>
   </a-modal>
 </template>
 
 <script>
-import { subareaSaveSubareaArea, subareaQuerySubareaArea } from '@/api/subarea'
+import { subareaSaveSubareaArea } from '@/api/subarea'
 export default {
-  name: 'MarketingDivisionSetEditModal',
+  name: 'MarketingDivisionAddZoneModal',
   components: { },
   props: {
     openModal: { //  弹框显示状态
@@ -47,27 +49,31 @@ export default {
     },
     parentData: {
       type: Object,
-      default: function(){
+      default: function () {
         return null
       }
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
-      return (this.parentData&&this.parentData.subareaAreaSn ? '编辑' : '新增') + '分区'
+      return (this.parentData && this.parentData.subareaAreaSn ? '编辑' : '新增') + '分区'
     }
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // 表单label设置
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      // 提交数据
       form: {
         subareaAreaName: '' // 分区名称
       },
+      // 表单验证规则
       zoneRules: {
         subareaAreaName: [
           { required: true, message: '请输入分区名称', trigger: 'blur' }
@@ -76,6 +82,7 @@ export default {
     }
   },
   methods: {
+    // 分区名称过滤
     filterEmpty () {
       let str = this.form.subareaAreaName
       str = str.replace(/\ +/g, '')
@@ -123,7 +130,7 @@ export default {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
         this.form.subareaAreaName = ''
-      }else{
+      } else {
         if (this.parentData.subareaAreaSn) {
           this.form.subareaAreaName = this.parentData.subareaAreaName
         }

+ 15 - 10
src/views/dealerManagement/marketingDivisionSetNew/list.vue

@@ -29,26 +29,26 @@
             class="button-info"
             v-if="record.type && record.type == 'root'"
             @click="addZone(record)"
-            id="marketingDivisionSetNew-edit-btn">新增分区</a-button>
+            :id="'marketingDivisionSetNew-edit-btn'+record.id">新增分区</a-button>
           <a-button
             size="small"
             type="link"
             class="button-success"
             v-else
             @click="handleView(record)"
-            id="marketingDivisionSetNew-edit-btn">查看经销商</a-button>
+            :id="'marketingDivisionSetNew-edit-btn'+record.id">查看经销商</a-button>
           <a-button
             size="small"
             type="link"
             class="button-info"
             @click="handleEdit(record)"
-            id="marketingDivisionSetNew-edit-btn">编辑</a-button>
+            :id="'marketingDivisionSetNew-edit-btn'+record.id">编辑</a-button>
           <a-button
             size="small"
             type="link"
             class="button-error"
             @click="handleDel(record)"
-            id="marketingDivisionSetNew-del-btn">删除</a-button>
+            :id="'marketingDivisionSetNew-del-btn'+record.id">删除</a-button>
         </template>
       </s-table>
     </a-spin>
@@ -76,10 +76,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import addAreaModal from './addAreaModal.vue'
 import addZoneModal from './addZoneModal.vue'
 import viewDealers from './viewDealers.vue'
+// 接口
 import { subareaQueryAll, deleteSubareaBySn, deleteSubareaAreaBySn } from '@/api/subarea'
 export default {
   name: 'MarketingDivisionSetNew',
@@ -88,10 +90,10 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
-      openAreaModal: false,
-      openZoneModal: false,
-      openDealerModal: false,
+      tableHeight: 0, // 表格高度
+      openAreaModal: false, // 打开区域弹窗
+      openZoneModal: false, // 打开分区弹窗
+      openDealerModal: false, // 打开经销商弹窗
       columns: [
         { title: '区域分区', scopedSlots: { customRender: 'titles' }, width: '70%', align: 'left' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '30%', align: 'center' }
@@ -103,6 +105,7 @@ export default {
           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
@@ -114,8 +117,8 @@ export default {
           return data
         })
       },
-      itemId: null,
-      parentData: null
+      itemId: null, // 营销分区id
+      parentData: null// 营销分区一行数据
     }
   },
   methods: {
@@ -170,12 +173,14 @@ export default {
       this.parentData = row
       this.openDealerModal = true
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 230

+ 39 - 32
src/views/dealerManagement/marketingDivisionSetNew/viewDealers.vue

@@ -12,7 +12,7 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 搜索条件 -->
         <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
-          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-form id="viewDealers-form" layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="8" :sm="24">
                 <a-form-item label="经销商名称/别名">
@@ -25,9 +25,9 @@
                 </a-form-item>
               </a-col>
               <a-col :md="8" :sm="24">
-                <a-form-model-item label="商户级别">
+                <a-form-item label="商户级别">
                   <v-select code="DEALER_LEVEL" id="viewDealers-dealerLevel" v-model="queryParam.dealer.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="8" :sm="24">
                 <a-form-item label="审核状态">
@@ -35,9 +35,9 @@
                 </a-form-item>
               </a-col>
               <a-col :md="8" :sm="24">
-                <a-form-model-item label="地区">
+                <a-form-item label="地区">
                   <AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                 <a-button type="primary" @click="searchForm" :disabled="disabled" id="viewDealers-refresh">查询</a-button>
@@ -46,19 +46,17 @@
             </a-row>
           </a-form>
         </div>
+        <!-- 操作按钮 -->
         <div style="margin-top:200px;" v-if="flag">
           <a-empty
             :image="simpleImage"
-            :image-style="{
-              height: '60px',
-            }"
-          >
+            :image-style="{height: '60px'}">
             <span slot="description"> 暂无数据 </span>
-            <a-button type="primary" class="button-error" @click="openAddDealer=true"><a-icon type="plus" />立即绑定经销商</a-button>
+            <a-button type="primary" id="viewDealers-binding" class="button-error" @click="openAddDealer=true"><a-icon type="plus" />立即绑定经销商</a-button>
           </a-empty>
         </div>
         <div class="tableCon" v-else>
-          <div style="margin-bottom:10px;"><a-button type="primary" class="button-error" @click="openAddDealer=true">绑定经销商</a-button></div>
+          <div style="margin-bottom:10px;"><a-button type="primary" id="viewDealers-binding-btn" class="button-error" @click="openAddDealer=true">绑定经销商</a-button></div>
           <s-table
             class="sTable"
             ref="table"
@@ -74,6 +72,7 @@
                 size="small"
                 type="link"
                 class="button-error"
+                :id="'viewDealers-del-btn'+record.id"
                 @click="handleDel(record)"
               >删除</a-button>
             </template>
@@ -81,7 +80,6 @@
         </div>
       </a-spin>
     </a-drawer>
-
     <!-- 绑定经销商 -->
     <a-drawer
       title="绑定经销商"
@@ -107,11 +105,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { Empty } from 'ant-design-vue'
+// 组件
 import { STable, VSelect } from '@/components'
 import chooseDealer from '@/views/common/chooseDealer.vue'
 import AreaList from '@/views/common/areaList.js'
-import { Empty } from 'ant-design-vue'
 import dealerType from '@/views/common/dealerType.js'
+// 接口
 import { queryPageAreaDealer, batchBindDealer, bindDealer, deleteBindDealer } from '@/api/subarea'
 export default {
   mixins: [commonMixin],
@@ -146,29 +146,27 @@ export default {
   },
   data () {
     return {
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
       spinning: false,
-      visible: this.showModal,
-      openAddDealer: false,
-      flag: true,
-      dealerType: [],
-      queryParam: { //  查询条件
+      disabled: false, // 查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 数据为空显示图片
+      visible: this.showModal, // 是否显示弹窗
+      openAddDealer: false, // 打开绑定经销商弹窗
+      flag: true, // 是否显示绑定经销商按钮
+      dealerType: [], // 商户类型
+      //  查询条件
+      queryParam: {
         dealer: {
-          nameLike: '',
+          nameLike: '', // 经销商名称/别名
           dealerType1: undefined, //  商户类型
           dealerType2: undefined, //  商户类型
-          dealerLevel: null,
-          auditState: undefined,
-          provinceSn: undefined,
-          citySn: undefined,
-          districtSn: undefined
+          dealerLevel: null, // 商户级别
+          auditState: undefined, // 审核状态
+          provinceSn: undefined, // 省
+          citySn: undefined, // 市
+          districtSn: undefined// 区
         }
       },
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
-      disabled: false,
-      tableHeight: 0,
       columns: [
         { title: '经销商名称', dataIndex: 'dealer.dealerName', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '商户别名', dataIndex: 'dealer.dealerAlias', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -184,6 +182,7 @@ export default {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = 0
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -201,6 +200,7 @@ export default {
     }
   },
   methods: {
+    // 商户类型 change
     getDealerType (v, o) {
       this.queryParam.dealer.dealerType1 = v[0]
       this.queryParam.dealer.dealerType2 = v[1]
@@ -213,7 +213,7 @@ export default {
           this.resetSearchForm()
           this.$refs.chooseDealer.searchForm(false)
         }
-        this.$refs.chooseDealer.searchForm
+        this.$refs.chooseDealer.searchForm()
       })
     },
     // 批量绑定
@@ -245,6 +245,7 @@ export default {
         }
       })
     },
+    // 查询
     searchForm () {
       if (this.flag) {
         this.hasData()
@@ -252,6 +253,7 @@ export default {
         this.$refs.table.refresh(true)
       }
     },
+    // 重置
     resetData () {
       this.dealerType = []
       this.queryParam = {
@@ -268,6 +270,7 @@ export default {
       }
       this.$refs.areaList.clearData()
     },
+    // 重置查询
     resetSearchForm () {
       if (this.flag) {
         this.hasData()
@@ -276,24 +279,28 @@ export default {
         this.$refs.table.refresh(true)
       }
     },
+    // 地区 change
     areaChange (val) {
       this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
       this.queryParam.dealer.citySn = val[1] ? val[1] : ''
       this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
     },
+    // 是否已有绑定数据
     async hasData () {
       const ret = await queryPageAreaDealer({ pageNo: 1, pageSize: 10, subareaSn: this.parentData.subareaSn, subareaAreaSn: this.parentData.subareaAreaSn }).then(res => res.data)
       this.flag = ret.count == 0
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
       this.flag = true
-      // 判断是已绑定数据
+      // 判断是已绑定数据
       this.hasData()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 290

+ 27 - 14
src/views/dealerManagement/merchantInfoManagement/chooseTypeModal.vue

@@ -14,6 +14,7 @@
         ref="ruleForm"
         :model="form"
         :rules="rules"
+        id="chooseType-form"
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
@@ -22,7 +23,7 @@
             code="PRICE_LEVEL"
             :notIn="notArr"
             style="width: 70%;"
-            id="productPriceLevel-level"
+            id="chooseType-level"
             v-model="form.priceLevel"
             allowClear
             :disabled="notArrFlag"
@@ -30,10 +31,10 @@
         </a-form-model-item>
         <a-form-model-item label="添加品类" prop="typeVal">
           <span v-for="(con,i) in filterList" :key="con.id" >
-            <a-checkbox :checked="con.checked" @change="e=>onChangeType(e.target.checked,i)" v-show="con.id!=4">
+            <a-checkbox id="chooseType-typeVal" :checked="con.checked" @change="e=>onChangeType(e.target.checked,i)" v-show="con.id!=4">
               {{ con.name }}
             </a-checkbox>
-            <a-checkbox :checked="con.checked" @change="e=>onChangeType(e.target.checked,i)" v-show="con.id==4&&disabledList.length==0">
+            <a-checkbox id="chooseType-typeVal1" :checked="con.checked" @change="e=>onChangeType(e.target.checked,i)" v-show="con.id==4&&disabledList.length==0">
               <a-tooltip placement="rightTop">
                 <template slot="title">
                   <span>选择全品类后,未来新加入的品类也将自动默认为已选择状态,无需再次手动操作。</span>
@@ -48,6 +49,7 @@
           <a-tree
             v-model="checkedList"
             checkable
+            id="chooseType-typeListBox"
             :auto-expand-parent="autoExpandParent"
             :tree-data="treeData"
             :replaceFields="replaceObj"
@@ -65,9 +67,10 @@
 </template>
 
 <script>
-import { dealerScopeCreate, queryWaitingData, dealerScopeQueryList } from '@/api/dealerScope'
-// import chooseTypeList from './chooseTypeList.vue'
+// 组件
 import { VSelect } from '@/components'
+// 接口
+import { dealerScopeCreate, queryWaitingData, dealerScopeQueryList } from '@/api/dealerScope'
 export default {
   name: 'ChooseTypeModal',
   components: { VSelect },
@@ -79,17 +82,18 @@ export default {
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // label 标签布局
       formItemLayout: {
         labelCol: { span: 3 },
         wrapperCol: { span: 20 }
       },
       form: {
         priceLevel: undefined, // 价格级别
-        typeVal: '0'
+        typeVal: '0'// 产品品类
       },
-      rules: {
+      rules: {// 表单验证规则
         priceLevel: [
           { required: true, message: '请选择价格级别', trigger: 'change' }
         ],
@@ -98,21 +102,23 @@ export default {
         ]
       },
       notArr: [], // 特约经销商  禁用选择
-      notArrFlag: false,
+      notArrFlag: false, // 价格级别禁用状态
       treeData: [], // 品牌分类数据
-      checkedList: [],
+      checkedList: [], // 已选产品分类
       autoExpandParent: false, // 是否自动展开父节点
-      replaceObj: {
+      replaceObj: {// 替换 treeNode 中 对应字段
         children: 'sonList', title: 'name', key: 'sn'
       },
       disabledList: [], // 已选过禁用调的品类数据
+      // 选择数据方式
       filterList: [{ id: '1', name: '全选', checked: false }, { id: '2', name: '自主品牌', checked: false }, { id: '3', name: '代理品牌', checked: false }, { id: '4', name: '全品类', checked: false }],
-      allBarndSnList: [],
-      ownBarndSnList: [],
-      agentBarndSnList: []
+      allBarndSnList: [], // 全选分类数据
+      ownBarndSnList: [], // 自主品牌分类数据
+      agentBarndSnList: []// 代理品牌分类数据
     }
   },
   methods: {
+    // 添加品类
     onChangeType (val, pos) {
       this.filterList.map(item => item.checked = false)
       this.filterList[pos].checked = val
@@ -166,6 +172,7 @@ export default {
               _this.$message.warning('请添加品类!')
               return
             }
+            // 全选时,过滤有禁用的已选过得品牌
             if (_this.disabledList.length > 0) {
               checkedArr = checkedArr.filter(items => {
                 if (!_this.disabledList.includes(items)) return items
@@ -175,6 +182,7 @@ export default {
                 return
               }
             }
+            // 重组 后台所需要的数据结构
             const arr = []
             checkedArr.forEach(item => {
               const newArr = item.split('_')
@@ -207,6 +215,7 @@ export default {
         }
       })
     },
+    // 获取已选择的品类
     getDataList () {
       const _this = this
       queryWaitingData({}).then(res => {
@@ -222,6 +231,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 重组已选择数据,禁用已选择数据
     async getDisabledList () {
       const res = await dealerScopeQueryList({ dealerSn: this.$route.params.sn })
       // 重组数据
@@ -233,6 +243,7 @@ export default {
         this.getDataList()
       }
     },
+    // 遍历树,添加disabled属性
     resetDisabledList (tree, arr) {
       // 遍历树节点
       function traverse (node) {
@@ -251,12 +262,14 @@ export default {
       // 返回修改后的树
       return tree
     },
+    // 点击复选框触发事件
     onCheck (checkedKeys) {
       this.checkedList = checkedKeys.checked
       this.filterList[0].checked = this.checkedList.length === this.allBarndSnList.length
       this.filterList[1].checked = this.checkedList.length === this.ownBarndSnList.length
       this.filterList[2].checked = this.checkedList.length === this.agentBarndSnList.length
     },
+    // 重组选中数据
     changeCheckedList () {
       const ret = []
       this.checkedList.forEach((item, index) => {

+ 17 - 25
src/views/dealerManagement/merchantInfoManagement/detailModal.vue

@@ -10,6 +10,7 @@
     :width="960">
     <a-spin :spinning="spinning" tip="Loading...">
       <div style="max-height: 400px;overflow: auto;" ref="merchantInfoDetail">
+        <!-- 基础信息 -->
         <a-card title="基础信息" size="small" style="margin-bottom: 15px;">
           <a-descriptions :column="2" bordered size="small">
             <a-descriptions-item label="经销商名称">{{ form&&form.dealerName ? form.dealerName : '--' }}</a-descriptions-item>
@@ -98,7 +99,9 @@
 </template>
 
 <script>
+// 组件
 import auditModal from '@/views/common/auditModal.vue'
+// 接口
 import { dealerAudit, dealerDetailBySn, dealerFindUpdateInfoBySn } from '@/api/dealer'
 export default {
   name: 'MerchantInfoManagementModal',
@@ -108,20 +111,20 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: {
+    itemId: { // 单据id
       type: [Number, String],
       default: ''
     },
-    isAudit: Boolean
+    isAudit: Boolean // 是否显示审核按钮
   },
   data () {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      form: null,
-      title: '',
-      visibleAudit: false,
-      spinningAudit: false
+      form: null, // 详情内容数据
+      title: '', // 弹窗标题
+      visibleAudit: false, // 是否打开审核弹窗
+      spinningAudit: false// 审核按钮加载状态
     }
   },
   methods: {
@@ -146,25 +149,14 @@ export default {
     // 详情编辑
     getDetail () {
       this.spinning = true
-      if (this.isAudit) {
-        dealerFindUpdateInfoBySn({ sn: this.itemId }).then(res => {
-          if (res.status == 200) {
-            this.form = res.data
-            this.spinning = false
-          } else {
-            this.spinning = false
-          }
-        })
-      } else {
-        dealerDetailBySn({ sn: this.itemId }).then(res => {
-          if (res.status == 200) {
-            this.form = res.data
-            this.spinning = false
-          } else {
-            this.spinning = false
-          }
-        })
-      }
+      // 根据是否审核状态选择不同的接口
+      const funs = this.isAudit ? dealerFindUpdateInfoBySn : dealerDetailBySn
+      funs({ sn: this.itemId }).then(res => {
+        if (res.status == 200) {
+          this.form = res.data
+        }
+        this.spinning = false
+      })
     }
   },
   watch: {

+ 70 - 66
src/views/dealerManagement/merchantInfoManagement/edit.vue

@@ -118,7 +118,7 @@
                 </a-col>
                 <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
                   <a-form-model-item label="默认仓库" prop="defaultWarehouseSn" >
-                    <chooseWarehouse ref="warehouse" v-model="form.defaultWarehouseSn"></chooseWarehouse>
+                    <chooseWarehouse ref="warehouse" id="merchantInfoManagementEdit-warehouse" v-model="form.defaultWarehouseSn"></chooseWarehouse>
                   </a-form-model-item>
                 </a-col>
               </a-row>
@@ -188,7 +188,7 @@
                   <a-form-model-item label="一般纳税人" prop="isTaxpayer">
                     <v-select
                       code="FLAG"
-                      id="customerManagementEdit-isTaxpayer"
+                      id="merchantInfoManagementEdit-isTaxpayer"
                       v-model="form.isTaxpayer"
                       allowClear
                       placeholder="请选择是否"
@@ -410,12 +410,14 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { getArea } from '@/api/data'
+import moment from 'moment'
+// 组件
 import { VSelect } from '@/components'
 import dealerType from '@/views/common/dealerType.js'
-import { dealerSave, dealerFindUpdateInfoBySn } from '@/api/dealer'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
-import moment from 'moment'
+// 接口
+import { getArea } from '@/api/data'
+import { dealerSave, dealerFindUpdateInfoBySn } from '@/api/dealer'
 export default {
   name: 'MerchantInfoManagementEdit',
   mixins: [commonMixin],
@@ -423,59 +425,57 @@ export default {
   data () {
     return {
       spinning: false,
+      // form表单布局
       formItemLayout: {
-        labelCol: {
-          span: 8
-        },
-        wrapperCol: {
-          span: 16
-        }
+        labelCol: { span: 8 },
+        wrapperCol: { span: 16 }
       },
-      dealerType: [],
+      dealerType: [], // 商户类型
       form: {
-        dealerName: '',
-        dealerAlias: '',
-        dealerType1: undefined,
-        dealerType2: undefined,
-        contact: '',
-        contactMobile: '',
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
-        address: '',
-        menuMouldId: undefined,
-        contactRole: '',
-        dealerTelephone: '',
-        busniessMode: '',
-        busniessItmes: '',
-        licenseName: '',
-        busniessScope: '',
-        buildDate: '',
-        isTaxpayer: undefined,
-        indentityCard: '',
-        brithday: '',
-        nativePlace: '',
-        mail: '',
-        contact2: '',
-        contactMobile2: '',
-        contractRole2: '',
-        zipCode: '',
-        receiveContact: '',
-        receiveMobile: '',
-        receiveProvinceSn: undefined,
-        receiveCitySn: undefined,
-        receiveDistrictSn: undefined,
-        receiveAddress: '',
-        tradeAccountName: '',
-        tradeBankName: '',
-        tradeBankAccount: '',
-        jgAutoPartsCode: '',
-        jgDoorHeaderChangeTime: '',
-        isShowSpecialPrice: 0,
-        remark: '',
-        kdMidCustomerFnumber: '',
-        defaultWarehouseSn: undefined
+        dealerName: '', // 经销商名称
+        dealerAlias: '', // 经销商别名
+        dealerType1: undefined, // 商户类型1
+        dealerType2: undefined, // 商户类型2
+        contact: '', // 联系人1
+        contactMobile: '', // 联系手机1
+        provinceSn: undefined, // 省sn
+        citySn: undefined, // 市 sn
+        districtSn: undefined, // 区sn
+        address: '', // 地址
+        menuMouldId: undefined, // 授权类型
+        contactRole: '', // 联系角色1
+        dealerTelephone: '', // 电话号码
+        busniessMode: '', // 经营方式
+        busniessItmes: '', // 经营项目
+        licenseName: '', // 营业执照名称
+        busniessScope: '', // 公司规模
+        buildDate: '', // 成立时间
+        isTaxpayer: undefined, // 一般纳税人
+        indentityCard: '', // 证件号码
+        brithday: '', // 生日
+        nativePlace: '', // 籍贯
+        mail: '', // 邮箱
+        contact2: '', // 联系人2
+        contactMobile2: '', // 手机号码2
+        contractRole2: '', // 联系角色2
+        zipCode: '', // 邮政编码
+        receiveContact: '', // 收货人
+        receiveMobile: '', // 电话号码
+        receiveProvinceSn: undefined, // 省sn
+        receiveCitySn: undefined, // 市sn
+        receiveDistrictSn: undefined, // 区sn
+        receiveAddress: '', // 收货详细地址
+        tradeAccountName: '', // 银行账户
+        tradeBankName: '', // 开户行
+        tradeBankAccount: '', // 银行卡号
+        jgAutoPartsCode: '', // 箭冠汽配代码
+        jgDoorHeaderChangeTime: '', // 门头更换日期
+        isShowSpecialPrice: 0, // 特约价是否可见 0否  1是
+        remark: '', // 备注
+        kdMidCustomerFnumber: '', // 财务编码
+        defaultWarehouseSn: undefined// 默认仓库
       },
+      // 规则验证
       rules: {
         dealerName: [
           { required: true, message: '请输入经销商名称', trigger: 'change' }
@@ -539,11 +539,12 @@ export default {
       addrProvinceList1: [], //  省下拉
       addrCityList1: [], //  市下拉
       addrDistrictList1: [], //  区下拉
-      dateFormat: 'YYYY-MM-DD',
-      detailData: null
+      dateFormat: 'YYYY-MM-DD', // 日期规则
+      detailData: null// 详情数据
     }
   },
   methods: {
+    // 银行账号 change
     bankAccountChange (e) {
       const { value } = e.target
       this.form.tradeBankAccount = value.replace(/\s*/g, '')
@@ -552,6 +553,7 @@ export default {
     disabledDate (date, dateStrings) {
       return date && date.valueOf() > Date.now()
     },
+    // 商户类型 change
     getDealerType (v, o) {
       this.form.dealerType1 = v[0]
       this.form.dealerType2 = v[1]
@@ -613,7 +615,7 @@ export default {
     },
     // 返回
     handleBack () {
-      this.$router.push({ path: '/dealerManagement/merchantInfoManagement/list', query: { closeLastOldTab: true } })
+      this.$router.push({ name: 'merchantInfoManagementList' })
     },
     // 获取城市列表
     getCityList (val) {
@@ -641,7 +643,6 @@ export default {
     },
     // 区县变更
     areaCharged (val) {
-      console.log(val)
       if (val) {
         this.form.districtName = this.addrDistrictList.find(item => item.areaSn == val).name
       } else {
@@ -690,18 +691,20 @@ export default {
       }
       getArea(params).then(res => {
         if (res.status == 200) {
+          const areaData = JSON.parse(JSON.stringify(res.data || []))
+          // 省
           if (leve == 'province') {
-            this.addrProvinceList = JSON.parse(JSON.stringify(res.data || []))
-            this.addrProvinceList1 = JSON.parse(JSON.stringify(res.data || []))
-          } else if (leve == 'city') {
-            this.addrCityList = JSON.parse(JSON.stringify(res.data || []))
+            this.addrProvinceList = areaData
+            this.addrProvinceList1 = areaData
+          } else if (leve == 'city') { // 市
+            this.addrCityList = areaData
             if (index == 1) {
-              this.addrCityList1 = JSON.parse(JSON.stringify(res.data || []))
+              this.addrCityList1 = areaData
             }
-          } else if (leve == 'district') {
-            this.addrDistrictList = JSON.parse(JSON.stringify(res.data || []))
+          } else if (leve == 'district') { // 县
+            this.addrDistrictList = areaData
             if (index == 1) {
-              this.addrDistrictList1 = JSON.parse(JSON.stringify(res.data || []))
+              this.addrDistrictList1 = areaData
             }
           }
         } else {
@@ -722,6 +725,7 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       this.getArea('province')
       this.$refs.ruleForm.resetFields()

+ 59 - 15
src/views/dealerManagement/merchantInfoManagement/list.vue

@@ -49,7 +49,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 id="merchantInfoManagementList-export">导出</a-button>
-              <a @click="advanced=!advanced" style="margin-left: 5px">
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="merchantInfoManagementList-advanced">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
               </a>
@@ -78,18 +78,54 @@
           bordered>
           <!-- 经销商 -->
           <template slot="dealerName" slot-scope="text, record">
-            <span v-if="$hasPermissions('B_merchantInfo_detail')" :title="record.dealerName" class="link-bule" @click="handleDetail(record)">{{ record.dealerName }}</span>
+            <span v-if="$hasPermissions('B_merchantInfo_detail')" :id="'merchantInfoManagementList-dealerName'+record.id" :title="record.dealerName" class="link-bule" @click="handleDetail(record)">{{ record.dealerName }}</span>
             <span v-else :title="record.dealerName">{{ record.dealerName }}</span>
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button size="small" type="link" class="button-warning" v-if="record.auditState == 'WAIT' && $hasPermissions('B_merchantInfo_audit')" @click="handleAudit(record)" >审核</a-button>
-            <a-button size="small" type="link" class="button-info" v-if="$hasPermissions('B_merchantInfo_cooperation')" @click="handleCooperation(record)" >合作设置</a-button>
-            <a-button size="small" type="link" class="button-primary" v-if="$hasPermissions('B_merchantInfo_level')" @click="handleLevel(record)">级别设置</a-button>
-            <a-button size="small" type="link" class="button-info" v-if="$hasPermissions('B_merchantInfo_edit')" @click="handleEdit(record)">编辑</a-button>
+            <a-button
+              size="small"
+              :id="'merchantInfoManagementList-audit-btn'+record.id"
+              type="link"
+              class="button-warning"
+              v-if="record.auditState == 'WAIT' && $hasPermissions('B_merchantInfo_audit')"
+              @click="handleAudit(record)" >审核</a-button>
+            <a-button
+              size="small"
+              :id="'merchantInfoManagementList-cooperation-btn'+record.id"
+              type="link"
+              class="button-info"
+              v-if="$hasPermissions('B_merchantInfo_cooperation')"
+              @click="handleCooperation(record)" >合作设置</a-button>
+            <a-button
+              size="small"
+              :id="'merchantInfoManagementList-level-btn'+record.id"
+              type="link"
+              class="button-primary"
+              v-if="$hasPermissions('B_merchantInfo_level')"
+              @click="handleLevel(record)">级别设置</a-button>
+            <a-button
+              size="small"
+              :id="'merchantInfoManagementList-edit-btn'+record.id"
+              type="link"
+              class="button-info"
+              v-if="$hasPermissions('B_merchantInfo_edit')"
+              @click="handleEdit(record)">编辑</a-button>
             <br>
-            <a-button size="small" type="link" class="button-error" v-if="record.auditState != 'WAIT'&&record.dealerLevel && $hasPermissions('B_merchantInfo_priceSpread')" @click="handlePriceSpread(record)">差价</a-button>
-            <a-button size="small" type="link" class="button-error" v-if="record.auditState != 'WAIT'&&record.dealerLevel && $hasPermissions('B_merchantInfo_distribution')" @click="handleDistribution(record)">经销权</a-button>
+            <a-button
+              size="small"
+              :id="'merchantInfoManagementList-price-btn'+record.id"
+              type="link"
+              class="button-error"
+              v-if="record.auditState != 'WAIT'&&record.dealerLevel && $hasPermissions('B_merchantInfo_priceSpread')"
+              @click="handlePriceSpread(record)">差价</a-button>
+            <a-button
+              size="small"
+              :id="'merchantInfoManagementList-power-btn'+record.id"
+              type="link"
+              class="button-error"
+              v-if="record.auditState != 'WAIT'&&record.dealerLevel && $hasPermissions('B_merchantInfo_distribution')"
+              @click="handleDistribution(record)">经销权</a-button>
             <span v-if="!(record.auditState == 'WAIT' && $hasPermissions('B_merchantInfo_audit')) && !$hasPermissions('B_merchantInfo_cooperation') && !(record.auditState != 'WAIT' && $hasPermissions('B_merchantInfo_distribution')) && !$hasPermissions('B_merchantInfo_level') && !$hasPermissions('B_merchantInfo_edit')">--</span>
           </template>
         </s-table>
@@ -113,13 +149,15 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
-import { dealerQueryList, dealerExport } from '@/api/dealer'
+// 组件
 import { STable, VSelect } from '@/components'
 import subarea from '@/views/common/subarea.js'
 import merchantInfoManagementDetailModal from './detailModal.vue'
 import UpdateCooperate from './updateCooperate.vue'
 import UpdateDealerLeve from './updateDealerLevel.vue'
 import dealerType from '@/views/common/dealerType.js'
+// 接口
+import { dealerQueryList, dealerExport } from '@/api/dealer'
 export default {
   name: 'MerchantInfoManagementList',
   mixins: [commonMixin],
@@ -128,8 +166,8 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      dealerType: [],
+      tableHeight: 0, // 表格高度
+      dealerType: [], // 所选商户类型 列表
       queryParam: { //  查询条件
         nameLike: '', //  商户名称、别名
         dealerType1: undefined, //  商户类型
@@ -144,8 +182,8 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
-      dateFormat: 'YYYY-MM-DD',
-      total: 0,
+      dateFormat: 'YYYY-MM-DD', // 日期显示格式
+      total: 0, // 总计
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -163,7 +201,6 @@ export default {
         { title: '生效时间', dataIndex: 'cooperateEffectiveTime', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ],
-      loading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -172,6 +209,7 @@ export default {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             this.total = data.count || 0
             for (var i = 0; i < data.list.length; i++) {
@@ -190,14 +228,16 @@ export default {
       openUcModal: false, // 合作设置 弹框
       openUdModal: false, // 级别设置 弹框
       itemId: '', //  当前商户sn
-      isAudit: false
+      isAudit: false// 是否显示审核按钮
     }
   },
   methods: {
+    // 区域  change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
+    // 商户类型 change
     getDealerType (v, o) {
       this.queryParam.dealerType1 = v[0]
       this.queryParam.dealerType2 = v[1]
@@ -295,6 +335,7 @@ export default {
         }
       })
     },
+    // 导出成功
     download (data) {
       if (!data) { return }
       const url = window.URL.createObjectURL(new Blob([data]))
@@ -307,18 +348,21 @@ export default {
       document.body.appendChild(link)
       link.click()
     },
+    // 初始化
     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(() => { // 页面渲染完成后的回调

+ 22 - 15
src/views/dealerManagement/merchantInfoManagement/permissionSettingNew.vue

@@ -20,17 +20,17 @@
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="品牌" prop="productBrandSn">
-                  <ProductBrand id="chooseProducts-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                  <ProductBrand id="permissionSetting-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品分类" prop="productType">
-                  <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="chooseProducts-productType"></productTypeAll>
+                  <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="permissionSetting-productType"></productTypeAll>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="价格级别" prop="priceLevel">
-                  <v-select code="PRICE_LEVEL" id="productLevelEdit-priceLevel" v-model="queryParam.priceLevel" allowClear placeholder="请选择价格级别"></v-select>
+                  <v-select code="PRICE_LEVEL" id="permissionSetting-priceLevel" v-model="queryParam.priceLevel" allowClear placeholder="请选择价格级别"></v-select>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -42,10 +42,10 @@
         </div>
         <!-- 操作按钮 -->
         <div class="table-operator">
-          <a-button type="primary" class="button-error" @click="chooseTModal">选择品类</a-button>
+          <a-button type="primary" id="permissionSetting-chooseType" class="button-error" @click="chooseTModal">选择品类</a-button>
           <span v-if="!showEmpty">
-            <a-button type="primary" v-if="$route.params.dealerLevel != 'SPECIAL'" class="button-info" @click="handleEdit()">批量编辑</a-button>
-            <a-button type="primary" ghost class="button-error" @click="handleDel()">批量删除</a-button>
+            <a-button type="primary" id="permissionSetting-moreEdit" v-if="$route.params.dealerLevel != 'SPECIAL'" class="button-info" @click="handleEdit()">批量编辑</a-button>
+            <a-button type="primary" id="permissionSetting-moreDel" ghost class="button-error" @click="handleDel()">批量删除</a-button>
           </span>
         </div>
         <!-- 列表 -->
@@ -77,12 +77,14 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import ChooseTypeModal from './chooseTypeModal.vue'
 import editPriceLevelModal from './priceLevelModal.vue'
 import productTypeAll from '@/views/common/productTypeAll.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import { Empty } from 'ant-design-vue'
+// 接口
 import { dealerScopeModifyPriceLevel, dealerScopeDelete, dealerScopeQueryList } from '@/api/dealerScope'
 export default {
   name: 'MerchantInfoManagementSet',
@@ -91,24 +93,24 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
         productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        priceLevel: undefined
+        priceLevel: undefined// 价格级别
       },
-      productType: [],
+      productType: [], // 产品分类
       disabled: false, //  查询、重置按钮是否可操作
       openTypeModal: false, //  选择产品分类
-      openPriceLevelModal: false,
-      itemPriceLevel: '',
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
-      dataSource: [],
-      showEmpty: false,
+      openPriceLevelModal: false, // 打开修改价格等级弹窗
+      itemPriceLevel: '', // 价格级别数据
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 空数据图片
+      dataSource: [], // 列表数据
+      showEmpty: false, // 数据是否为空
       showTableHead: true, // 显示表头
-      selectedRowKeys: []
+      selectedRowKeys: []// 已选数据
     }
   },
   computed: {
@@ -147,6 +149,7 @@ export default {
       ]
       return arr
     },
+    // 选择列表数据
     checkboxOption () {
       const _this = this
       return {
@@ -163,6 +166,7 @@ export default {
     }
   },
   methods: {
+    // 获取列表数据
     getData () {
       const _this = this
       _this.disabled = true
@@ -222,6 +226,7 @@ export default {
         }
       })
     },
+    // 关闭价格级别弹窗
     closePriceLevelModal () {
       this.itemPriceLevel = ''
       this.openPriceLevelModal = false
@@ -273,12 +278,14 @@ export default {
       this.selectedRowKeys = []
       this.$router.push({ path: '/dealerManagement/merchantInfoManagement/list', query: { closeLastOldTab: true } })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 205

+ 9 - 7
src/views/dealerManagement/merchantInfoManagement/priceLevelModal.vue

@@ -21,26 +21,26 @@
           <v-select
             code="PRICE_LEVEL"
             :notIn="notArr"
-            id="productPriceLevel-level"
+            id="priceLevel-modal-level"
             v-model="form.priceLevel"
             allowClear
             placeholder="请选择价格级别"></v-select>
-
         </a-form-model-item>
         <div class="fontRed">注意:价格变更后,该商户的差价设置将同步清空</div>
       </a-form-model>
       <div class="btn-cont">
-        <a-button id="chooseType-modal-back" @click="isShow = false" >取消</a-button>
-        <a-button type="primary" style="margin-left: 15px;" id="chooseType-modal-save" @click="handleSave">确定</a-button>
+        <a-button id="priceLevel-modal-back" @click="isShow = false" >取消</a-button>
+        <a-button type="primary" style="margin-left: 15px;" id="priceLevel-modal-save" @click="handleSave">确定</a-button>
       </div>
     </a-spin>
   </a-modal>
 </template>
 
 <script>
+// 组件
 import { VSelect } from '@/components'
 export default {
-  name: 'ChooseTypeModal',
+  name: 'PriceLevelModal',
   components: { VSelect },
   props: {
     openModal: { //  弹框显示状态
@@ -54,16 +54,18 @@ export default {
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // form 表单布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
-      notArr: [],
+      notArr: [], // 价格级别禁选数据
       form: {
         priceLevel: undefined // 价格级别
       },
+      // 表单验证规则
       rules: {
         priceLevel: [
           { required: true, message: '请选择价格等级', trigger: 'change' }

+ 21 - 14
src/views/dealerManagement/merchantInfoManagement/updateCooperate.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="merchantInfoManagement-modal"
+    class="updateCooperate-modal"
     :footer="null"
     :maskClosable="false"
     :title="title"
@@ -16,24 +16,25 @@
           :rules="rules"
           :label-col="labelCol"
           :wrapper-col="wrapperCol"
+          id="updateCooperate-form"
         >
           <a-form-model-item label="商户名称">
             {{ form.dealerName }}
           </a-form-model-item>
           <a-form-model-item label="合作状态" prop="cooperateFlag">
-            <v-select code="DEALER_COOPERATE_FLAG" id="ucModal-cooperateFlag" v-model="form.cooperateFlag" allowClear placeholder="请选择合作状态"></v-select>
+            <v-select code="DEALER_COOPERATE_FLAG" id="updateCooperate-cooperateFlag" v-model="form.cooperateFlag" allowClear placeholder="请选择合作状态"></v-select>
           </a-form-model-item>
           <a-form-model-item label="生效时间" prop="cooperateEffectiveTime">
             <a-date-picker
               style="width:100%"
-              id="ucModal-cooperateEffectiveTime"
+              id="updateCooperate-cooperateEffectiveTime"
               v-model="form.cooperateEffectiveTime"
               :format="dateFormat"
               placeholder="请选择日期" />
           </a-form-model-item>
           <div style="display: flex;justify-content: center;padding: 30px 0;">
-            <a-button  @click="cansel">取消</a-button>
-            <a-button style="margin-left: 15px;" type="primary" @click="onSubmit">确定</a-button>
+            <a-button id="updateCooperate-cancel-btn" @click="cancel">取消</a-button>
+            <a-button id="updateCooperate-submit-btn" style="margin-left: 15px;" type="primary" @click="onSubmit">确定</a-button>
           </div>
         </a-form-model>
       </a-spin>
@@ -43,9 +44,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+// 组件
 import { VSelect } from '@/components'
+// 接口
 import { updateCooperate } from '@/api/dealer'
-import moment from 'moment'
 export default {
   name: 'UpdateCooperate',
   mixins: [commonMixin],
@@ -60,16 +63,17 @@ export default {
     return {
       isShow: this.openUcModal, //  是否打开弹框
       spinning: false,
-      title: '合作设置',
-      dateFormat: 'YYYY-MM-DD',
-      labelCol: { span: 5 },
+      title: '合作设置', // 表格标题
+      dateFormat: 'YYYY-MM-DD', // 日期格式
+      labelCol: { span: 5 }, // form表单label布局
       wrapperCol: { span: 16 },
-      other: '',
+      // 提交数据
       form: {
-        dealerName: '',
-        cooperateFlag: undefined,
-        cooperateEffectiveTime: null
+        dealerName: '', // 商户名称
+        cooperateFlag: undefined, // 合作状态
+        cooperateEffectiveTime: null// 生效时间
       },
+      // 表单验证规则
       rules: {
         cooperateFlag: [
           { required: true, message: '请选择合作状态', trigger: 'change' }
@@ -85,12 +89,14 @@ export default {
     disabledDate (date, dateStrings) {
       return date && date.valueOf() > Date.now()
     },
+    // 赋值
     setData (row) {
       this.form.dealerSn = row.dealerSn
       this.form.dealerName = row.dealerName
       this.form.cooperateFlag = row.cooperateFlag
       this.form.cooperateEffectiveTime = row.cooperateEffectiveTime
     },
+    // 确定提交
     onSubmit () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -112,7 +118,8 @@ export default {
         }
       })
     },
-    cansel () {
+    // 取消
+    cancel () {
       this.$emit('close')
       this.$refs.ruleForm.resetFields()
     }

+ 20 - 12
src/views/dealerManagement/merchantInfoManagement/updateDealerLevel.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="merchantInfoManagement-modal"
+    class="updateDealerLevel-modal"
     :footer="null"
     :maskClosable="false"
     :title="title"
@@ -11,6 +11,7 @@
     <div>
       <a-spin :spinning="spinning" tip="Loading...">
         <a-form-model
+          id="updateDealerLevel-form"
           ref="ruleForm"
           :model="form"
           :rules="rules"
@@ -21,11 +22,11 @@
             {{ form.dealerName }}
           </a-form-model-item>
           <a-form-model-item label="商户级别" prop="dealerLevel">
-            <v-select code="DEALER_LEVEL" id="ucModal-dealerLevel" v-model="form.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
+            <v-select code="DEALER_LEVEL" id="updateDealerLevel-dealerLevel" v-model="form.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
           </a-form-model-item>
           <div style="display: flex;justify-content: center;padding: 30px 0;">
-            <a-button @click="cansel">取消</a-button>
-            <a-button style="margin-left: 15px;" type="primary" @click="onSubmit">确定</a-button>
+            <a-button id="updateDealerLevel-cancel-btn" @click="cancel">取消</a-button>
+            <a-button id="updateDealerLevel-submit-btn" style="margin-left: 15px;" type="primary" @click="onSubmit">确定</a-button>
           </div>
         </a-form-model>
       </a-spin>
@@ -35,7 +36,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { VSelect } from '@/components'
+// 接口
 import { updateDealerLevel } from '@/api/dealer'
 export default {
   name: 'UpdateDealerLevel',
@@ -51,24 +54,26 @@ export default {
     return {
       isShow: this.openUdModal, //  是否打开弹框
       spinning: false,
-      title: '级别设置',
-      labelCol: { span: 5 },
+      title: '级别设置', // 标题
+      labelCol: { span: 5 }, // form表单布局
       wrapperCol: { span: 16 },
-      other: '',
+      // 提交数据
       form: {
-        dealerName: '',
-        dealerLevel: undefined
+        dealerName: '', // 商户名称
+        dealerLevel: undefined// 商户级别
       },
+      // 表单验证规则
       rules: {
         dealerLevel: [
           { required: true, message: '请选择商户级别', trigger: 'change' }
         ]
       },
-      dealerLevelBak: undefined,
-      isProvincialCustomers: ''
+      dealerLevelBak: undefined, // 商户级别回显数据
+      isProvincialCustomers: ''// 省仓客户
     }
   },
   methods: {
+    // 设置数据
     setData (row) {
       this.form.dealerSn = row.dealerSn
       this.form.dealerName = row.dealerName
@@ -76,6 +81,7 @@ export default {
       this.dealerLevelBak = row.dealerLevel
       this.isProvincialCustomers = row.serviceCenterSn ? '1' : '0'// 是否是省仓客户
     },
+    // 提交判断必填项
     onSubmit () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -86,6 +92,7 @@ export default {
         }
       })
     },
+    // 提交
     submitForm () {
       const _this = this
       const params = JSON.parse(JSON.stringify(_this.form))
@@ -100,7 +107,8 @@ export default {
         }
       })
     },
-    cansel () {
+    // 取消
+    cancel () {
       this.$emit('close')
       this.$refs.ruleForm.resetFields()
     }

+ 9 - 2
src/views/dealerManagement/provincialWarehouseManagement/addModal.vue

@@ -12,6 +12,7 @@
       <!-- 表单 -->
       <a-form-model
         ref="ruleForm"
+        id="addProvincialWarehouse-form"
         :model="form"
         :rules="zoneRules"
         :label-col="formItemLayout.labelCol"
@@ -20,7 +21,7 @@
       >
         <a-form-model-item label="设为省仓" prop="serviceCenterName">
           <custList
-            id="dealerZoneSearch-dealerName"
+            id="addProvincialWarehouse-dealerName"
             cooperateFlag="1"
             dealerLevel="PROVINCE"
             placeholder="请输入经销商名称搜索"
@@ -37,7 +38,9 @@
 </template>
 
 <script>
+// 组件
 import custList from '@/views/common/custList.vue'
+// 接口
 import { serviceCenterAdd } from '@/api/serviceCenter'
 export default {
   name: 'AddProvincialWarehouseModal',
@@ -55,22 +58,26 @@ export default {
     }
   },
   computed: {
+    // 弹窗标题
     modalTit () {
       return (this.parentData && this.parentData.subareaAreaSn ? '编辑' : '新增') + '省仓'
     }
   },
   data () {
     return {
-      isShow: this.openModal, //  是否打开弹框
       spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      // 表单label布局
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      // 提交数据
       form: {
         serviceCenterSn: undefined, // 经销商sn
         serviceCenterName: undefined// 经销商名称
       },
+      // 表单规则验证
       zoneRules: {
         serviceCenterName: [
           { required: true, message: '请输入经销商名称', trigger: 'blur' }

+ 32 - 22
src/views/dealerManagement/provincialWarehouseManagement/chooseDealer.vue

@@ -5,9 +5,9 @@
       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="8" :sm="24">
-            <a-form-model-item label="地区">
-              <AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-            </a-form-model-item>
+            <a-form-item label="地区">
+              <AreaList id="chooseDealer-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+            </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24">
             <a-form-item label="经销商名称/别名">
@@ -20,9 +20,9 @@
             </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24">
-            <a-form-model-item label="商户级别" prop="dealerLevel">
-              <v-select code="DEALER_LEVEL" id="ucModal-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
-            </a-form-model-item>
+            <a-form-item label="商户级别" prop="dealerLevel">
+              <v-select code="DEALER_LEVEL" id="chooseDealer-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
+            </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24">
             <a-form-item label="所在区域/分区">
@@ -37,7 +37,7 @@
       </a-form>
       <!-- 列表 -->
       <div style="margin-bottom: 10px">
-        <a-button type="primary" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
+        <a-button type="primary" id="chooseDealer-add" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
         <span style="margin-left: 5px">
           <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template>
         </span>
@@ -66,17 +66,19 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import AreaList from '@/views/common/areaList.js'
 import subarea from '@/views/common/subarea.js'
 import dealerType from '@/views/common/dealerType.js'
-import { getDealerListInfo, dealerQueryList } from '@/api/dealer'
+// 组件
+import { dealerQueryList } from '@/api/dealer'
 export default {
   name: 'ChooseDealer',
   mixins: [commonMixin],
   components: { STable, VSelect, subarea, AreaList, dealerType },
   props: {
-    pageType: {
+    pageType: {// 页面类型
       type: String,
       default: 'dealerPromotion'
     },
@@ -87,26 +89,26 @@ export default {
   },
   data () {
     return {
-      tableHeight: 0,
       spinning: false,
-      dealerType: [],
-      queryParam: { //  查询条件
-        nameLike: '',
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, // 批量添加loading,
+      tableHeight: 0, // 表格高度
+      dealerType: [], // 商户类型
+      //  查询条件
+      queryParam: {
+        nameLike: '', // 经销商名称/别名
         dealerType1: undefined, //  商户类型
         dealerType2: undefined, //  商户类型
-        dealerLevel: null,
+        dealerLevel: null, // 商户级别
         subareaArea: {
           subareaSn: undefined, //  区域
           subareaAreaSn: undefined // 分区
         },
-        auditState: undefined,
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined
+        provinceSn: undefined, // 省sn
+        citySn: undefined, // 市sn
+        districtSn: undefined// 区sn
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      loading: false, // 批量添加loading,
-      rowSelectionInfo: null,
+      rowSelectionInfo: null, // 已选列表数据
       columns: [
         { title: '经销商名称', dataIndex: 'dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '商户别名', dataIndex: 'dealerAlias', align: 'left', width: '30%', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -126,6 +128,7 @@ export default {
           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
@@ -142,6 +145,7 @@ export default {
     }
   },
   computed: {
+    // 计算选中数据条数
     selectCount () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
     }
@@ -151,18 +155,22 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
+    // 商户类型 change
     getDealerType (v, o) {
       this.queryParam.dealerType1 = v[0]
       this.queryParam.dealerType2 = v[1]
     },
+    // 地区 change
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
+    // 查询
     searchForm () {
       this.$refs.table.refresh()
     },
+    // 所在区域/分区 change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -179,7 +187,6 @@ export default {
           subareaSn: undefined, //  区域
           subareaAreaSn: undefined // 分区
         },
-        auditState: undefined,
         provinceSn: undefined,
         citySn: undefined,
         districtSn: undefined
@@ -188,6 +195,7 @@ export default {
       this.$refs.areaList.clearData()
       this.$refs.table.refresh()
     },
+    // 清除所选数据
     clearSelect () {
       this.$refs.table.clearSelected()
     },
@@ -200,10 +208,12 @@ export default {
       }
       this.$emit('plAdd', _this.rowSelectionInfo.selectedRows)
     },
+    // 初始化
     pageInit (data) {
       this.setTableH()
       this.resetSearchForm()
     },
+    // 计算表格高度
     setTableH () {
       const headHeight = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - headHeight - 190

+ 15 - 9
src/views/dealerManagement/provincialWarehouseManagement/list.vue

@@ -83,23 +83,27 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import provincialWarehouseAddModal from './addModal.vue'
+// 接口
 import { serviceCenterList, provincialWarehouseEnable, serviceCenterBinding } from '@/api/serviceCenter'
 export default {
-  name: 'DealerAccountManagementList',
+  name: 'ProvincialWarehouse',
   mixins: [commonMixin],
   components: { STable, VSelect, provincialWarehouseAddModal },
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
-      queryParam: { //  查询条件
-        serviceCenterName: '',
-        dealerName: '',
-        enableFlag: undefined
-      },
+      tableHeight: 0, // 列表高度
       disabled: false, //  查询、重置按钮是否可操作
+      openModal: false, //  新增编辑  弹框
+      //  查询条件
+      queryParam: {
+        serviceCenterName: '', // 省仓名称
+        dealerName: '', // 经销商名称
+        enableFlag: undefined// 省仓状态
+      },
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '10%', align: 'center' },
@@ -119,6 +123,7 @@ export default {
           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
@@ -129,8 +134,7 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      openModal: false //  新增编辑  弹框
+      }
     }
   },
   methods: {
@@ -189,12 +193,14 @@ export default {
         this.$refs.table.refresh()
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240

+ 41 - 30
src/views/dealerManagement/provincialWarehouseManagement/relatedDealersList.vue

@@ -18,14 +18,14 @@
               <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
                 <a-row :gutter="15">
                   <a-col :md="4" :sm="24">
-                    <a-form-model-item label="地区">
-                      <AreaList id="actualSalesReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-                    </a-form-model-item>
+                    <a-form-item label="地区">
+                      <AreaList id="relatedDealersList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                    </a-form-item>
                   </a-col>
                   <a-col :md="4" :sm="24">
-                    <a-form-model-item label="区域/分区">
+                    <a-form-item label="区域/分区">
                       <subarea ref="subarea" id="relatedDealersList-subarea" @change="subareaChange"></subarea>
-                    </a-form-model-item>
+                    </a-form-item>
                   </a-col>
                   <a-col :md="4" :sm="24">
                     <a-form-item label="经销商名称">
@@ -38,14 +38,15 @@
                     </a-form-item>
                   </a-col>
                   <a-col :md="4" :sm="24">
-                    <a-form-model-item label="商户级别" prop="dealerLevel">
+                    <a-form-item label="商户级别" prop="dealerLevel">
                       <v-select code="DEALER_LEVEL" id="relatedDealersList-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
-                    </a-form-model-item>
+                    </a-form-item>
                   </a-col>
                   <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
-                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
-                    <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
+                    <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="relatedDealersList-refresh">查询</a-button>
+                    <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="relatedDealersList-reset">重置</a-button>
                     <a-button
+                      id="relatedDealersList-export"
                       style="margin-left: 10px"
                       type="primary"
                       class="button-warning"
@@ -58,8 +59,9 @@
                 </a-row>
               </a-form>
             </div>
+            <!-- 操作按钮 -->
             <div class="relatedDealersList-btn" style="margin-bottom:10px;">
-              <a-button type="primary" @click="openDealersModal">新增经销商</a-button>
+              <a-button id="relatedDealersList-add" type="primary" @click="openDealersModal">新增经销商</a-button>
             </div>
             <!-- 列表 -->
             <s-table
@@ -87,7 +89,7 @@
                   v-if="$hasPermissions('B_serviceCenter_unbinding')"
                   class="button-info"
                   @click="handleDelete(record)"
-                  id="provincialWarehouse-edit-btn">解绑</a-button>
+                  :id="'relatedDealersList-edit-btn'+record.dealerSn">解绑</a-button>
                 <span v-else>--</span>
               </template>
             </s-table>
@@ -103,8 +105,7 @@
       :visible="openDealerModal"
       class="lookUpCustomers-modal"
       @close="closeDealerModal"
-      width="72%"
-    >
+      width="72%">
       <div class="dealerModalCon">
         <chooseDealer ref="dealerChoose" :itemSn="$route.params.sn" @plAdd="handleAddDealer"></chooseDealer>
       </div>
@@ -114,38 +115,42 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import chooseDealer from './chooseDealer.vue'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
-import { hdExportExcel } from '@/libs/exportExcel'
 import dealerType from '@/views/common/dealerType.js'
+// 接口
 import { queryServiceCenterDealerPage, serviceCenterBinding, serviceCenterUnbinding, serviceCenterExport } from '@/api/serviceCenter'
 export default {
-  name: 'LookUpCustomers',
+  name: 'RelatedDealersList',
   mixins: [commonMixin],
   components: { STable, VSelect, chooseDealer, subarea, AreaList, dealerType },
   data () {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      disabled: false,
-      exportLoading: false,
-      dealerType: [],
+      disabled: false, // 查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      dealerType: [], // 商户类型
+      // 查询参数
       queryParam: {
-        subareaSn: undefined,
-        subareaAreaSn: undefined,
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
-        nameLike: '',
-        relationType: 'purchase',
+        subareaSn: undefined, // 区域
+        subareaAreaSn: undefined, // 分区
+        provinceSn: undefined, // 省sn
+        citySn: undefined, // 市sn
+        districtSn: undefined, // 区sn
+        nameLike: '', // 经销商名称
+        relationType: 'purchase', // 关系类型
         dealerType1: undefined, //  商户类型
         dealerType2: undefined, //  商户类型
-        dealerLevel: undefined
+        dealerLevel: undefined// 商户级别
       },
-      tableHeight: 0,
-      activeKeyVal: '1',
+      tableHeight: 0, // 表格高度
+      activeKeyVal: '1', // 基础信息是否显示
+      openDealerModal: false, // 打开经销商弹窗
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -154,6 +159,7 @@ export default {
           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
@@ -178,8 +184,7 @@ export default {
         { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '添加时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
-      ],
-      openDealerModal: false
+      ]
     }
   },
   methods: {
@@ -195,6 +200,7 @@ export default {
       this.openDealerModal = false
       this.$refs.dealerChoose.clearSelect()
     },
+    // 商户类型 change
     getDealerType (v, o) {
       this.queryParam.dealerType1 = v[0]
       this.queryParam.dealerType2 = v[1]
@@ -222,11 +228,13 @@ export default {
         this.$refs.table.refresh()
       })
     },
+    // 地区 change
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
+    // 区域分区  change
     subareaChange (val) {
       this.queryParam.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
@@ -247,6 +255,7 @@ export default {
         }
       })
     },
+    // 确定解绑
     submitDel (params) {
       this.spinning = true
       serviceCenterUnbinding(params).then(res => {
@@ -292,6 +301,7 @@ export default {
     handleBack () {
       this.$router.push({ name: 'provincialWarehouseList' })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -299,6 +309,7 @@ export default {
       })
       _this.resetSearchForm()
     },
+    // 计算列表高度
     setTableH () {
       const headHeight = this.$refs.headerBar.offsetHeight
       this.tableHeight = window.innerHeight - headHeight - 340

+ 19 - 11
src/views/dealerManagement/rebateBinding/categoryList.vue

@@ -21,9 +21,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { Empty } from 'ant-design-vue'
+// 组件
 import { VSelect } from '@/components'
+// 接口
 import { dealerUpsList, dealerUpsDelete } from '@/api/dealer'
-import { Empty } from 'ant-design-vue'
 // 子表格
 const ChildTableComp = {
   name: 'ChildTableComp',
@@ -48,7 +50,7 @@ const ChildTableComp = {
   },
   data () {
     return {
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 为空 图片地址
       columns: [
         { title: '序号', field: 'no', key: 'a', width: 40, align: 'center', operationColumn: false },
         { title: '品牌', field: 'productBrandName', key: 'b', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
@@ -75,13 +77,13 @@ export default {
   },
   data () {
     return {
-      disabled: false, //  查询、重置按钮是否可操作
       spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
       simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
-      dataSource: [],
-      list: [],
-      tableHeight: this.maxHeight,
-      columnWidthResizeOption: {
+      dataSource: [], // 列表数据
+      list: [], // 重组后适合的列表数据
+      tableHeight: this.maxHeight, // 表格高度
+      columnWidthResizeOption: {// 表格列宽设置
         // default false
         enable: true,
         // column resize min width
@@ -98,9 +100,9 @@ export default {
           this.changeExpandedRowKeys(afterExpandedRowKeys)
         }
       },
-      showEmpty: true,
-      checkedDealerSn: [],
-      isTeyue: false
+      showEmpty: true, // 是否显示空页面
+      checkedDealerSn: [], // 选中的经销商sn集合
+      isTeyue: false// 是否显示删除按钮
     }
   },
   computed: {
@@ -149,7 +151,7 @@ export default {
           </div>
         )
       }
-
+      // 表格展开收起功能
       const expendFormat = function (record, data, h) {
         if (_this.isTeyue) {
           return (<span>-</span>)
@@ -213,7 +215,9 @@ export default {
       const no = 0
       for (let i = 0; i < listData.length; i++) {
         const item = listData[i]
+        // 筛选品牌 一级、二级、三级分类数据 渲染展开表格
         const rebateScopeList = item.rebateScopeList ? this.filterData(item.rebateScopeList, queryParam) : [{ productBrandName: null, productTypeName1: null, productTypeName2: null, productTypeName3: null }]
+        // SUPERIORS 上级经销商    HEAD 总部经销商    ASSIGN 指定经销商
         const supDealerList = item.rebateDealerList.find(b => b.rebateParentType == 'SUPERIORS')
         const headDealerList = item.rebateDealerList.find(b => b.rebateParentType == 'HEAD')
         const zdDealerList = item.rebateDealerList.filter(b => b.rebateParentType == 'ASSIGN')
@@ -247,6 +251,7 @@ export default {
 
       return ret.filter(item => item.childData.length > 0)
     },
+    // 列表数据查询
     searchTable (queryParam) {
       if (this.dataSource.length) {
         this.$emit('loaded', this.dataSource)
@@ -270,12 +275,14 @@ export default {
         })
       }
     },
+    // 编辑
     handleEdit (record, e) {
       console.log(e)
       e.stopPropagation()
       const row = this.dataSource.find(item => item.dealerUpsSn == record.dealerUpsSn && item.dealerSn == record.dealerSn)
       this.$emit('edit', row)
     },
+    // 删除
     handleDel (record, e) {
       e.stopPropagation()
       const _this = this
@@ -298,6 +305,7 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit (queryParam, isTeyue) {
       this.isTeyue = isTeyue
       // 获取列表

+ 21 - 14
src/views/dealerManagement/rebateBinding/categoryTree.vue

@@ -33,11 +33,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { VSelect } from '@/components'
-import { dealerUpsPlTree } from '@/api/dealer'
 import { Empty } from 'ant-design-vue'
+// 组件
+import { VSelect } from '@/components'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
+// 接口
+import { dealerUpsPlTree } from '@/api/dealer'
 export default {
   name: 'DetailProductList',
   mixins: [commonMixin],
@@ -59,27 +61,29 @@ export default {
   data () {
     return {
       spinning: false,
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
-      dataSource: [],
-      showEmpty: true,
-      dealerSn: undefined,
-      parentDealerSn: undefined,
-      checkedKeys: [],
-      halfCheckedKeys: [],
-      allLeafKeys: [],
-      allBrands: [],
-      check1: false,
-      check2: false,
-      check3: false
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 为空显示的图片
+      dataSource: [], // 树数据
+      showEmpty: true, // 是否显示为空图片
+      dealerSn: undefined, // 经销商sn
+      parentDealerSn: undefined, // 上级经销商sn
+      checkedKeys: [], // 选中数据
+      halfCheckedKeys: [], // 选中孩子节点数据
+      allLeafKeys: [], // 所有子节点数据
+      allBrands: [], // 所有品牌数据
+      check1: false, // 全选
+      check2: false, // 自主品牌
+      check3: false// 代理品牌
     }
   },
   computed: {
 
   },
   methods: {
+    // 树 check 事件
     onCheck (checkedKeys, info) {
       // console.log('onCheck', checkedKeys, info)
       this.checkedKeys = checkedKeys
+      // 选中孩子节点数据
       this.halfCheckedKeys = info.halfCheckedKeys
       if (this.check1) {
         this.check1 = false
@@ -91,6 +95,7 @@ export default {
         this.check3 = false
       }
     },
+    // 获取选中数据,重组所选数据结构
     getResult () {
       // 所有已选叶子节点
       const ret = this.allLeafKeys.filter(item => this.checkedKeys.includes(item.sn))
@@ -176,6 +181,7 @@ export default {
         this.$message.info('请选择上级经销商')
       }
     },
+    // 获取树数据
     async getTreeData () {
       this.dataSource = []
       this.allLeafKeys = []
@@ -195,6 +201,7 @@ export default {
       }
       this.spinning = false
     },
+    // 初始化
     pageInit (detailData, parentDealerSn, dealerSn) {
       this.detailData = detailData
       this.parentDealerSn = parentDealerSn

+ 35 - 21
src/views/dealerManagement/rebateBinding/list.vue

@@ -22,12 +22,12 @@
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="品牌">
-                  <ProductBrand v-model="queryParam.productBrandSn"></ProductBrand>
+                  <ProductBrand id="rebateBinding-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品分类">
-                  <ProductType placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+                  <ProductType id="rebateBinding-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
                 </a-form-model-item>
               </a-col>
               <!-- <a-col :md="6" :sm="24" v-if="!isTeyue">
@@ -42,7 +42,13 @@
               </a-col> -->
               <a-col :md="6" :sm="24" v-show="false">
                 <a-form-model-item label="差价归属方">
-                  <v-select code="REBATE_PARENT_TYPE" ref="rpType" v-model="queryParam.rebateParentType" allowClear placeholder="请选择差价归属方"></v-select>
+                  <v-select
+                    id="rebateBinding-rebateParentType"
+                    code="REBATE_PARENT_TYPE"
+                    ref="rpType"
+                    v-model="queryParam.rebateParentType"
+                    allowClear
+                    placeholder="请选择差价归属方"></v-select>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -56,14 +62,13 @@
         <div class="table-operator" style="display: flex;align-items: center;justify-content: space-between;" v-if="showBtns">
           <a-button id="rebateBinding-brand" type="primary" class="button-error" @click="openGlModal">差价设置</a-button>
           <div v-if="!isTeyue && hasData">
-            <a-button type="default" @click="expandAllRow">{{ expandAll?'收起全部':'展开全部' }}</a-button>
+            <a-button id="rebateBinding-isTeyue" type="default" @click="expandAllRow">{{ expandAll?'收起全部':'展开全部' }}</a-button>
           </div>
         </div>
         <!-- 列表 -->
         <categoryList ref="categoryList" @loaded="loadList" @del="delOk" @edit="handleEdit" :maxHeight="tableHeight"></categoryList>
       </a-card>
     </a-spin>
-
     <!-- 差价设置 -->
     <priceDiffModal ref="priceDiffModal" :openModal="openModal" @ok="resetGetData" @close="openModal=false"></pricediffmodal>
   </div>
@@ -71,12 +76,14 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
-import { dealerDetailBySn } from '@/api/dealer'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import priceDiffModal from './priceDiffModal.vue'
 import categoryList from './categoryList'
+// 接口
+import { dealerDetailBySn } from '@/api/dealer'
 export default {
   name: 'RebateBinding',
   mixins: [commonMixin],
@@ -84,27 +91,29 @@ export default {
   data () {
     return {
       spinning: false,
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
       loading: false, //  表格加载中
-      openModal: false,
-      detail: null,
-      productType: [],
-      queryParam: { //  查询条件
-        rebateParentType: undefined,
-        priceLevel: undefined,
-        productBrandSn: undefined,
-        productTypeSn1: undefined,
-        productTypeSn2: undefined,
-        productTypeSn3: undefined,
-        dealerName: ''
+      openModal: false, // 差价设置弹窗
+      detail: null, // 详情数据
+      productType: [], // 产品分类查询数据
+      //  查询条件
+      queryParam: {
+        rebateParentType: undefined, // 差价归属方
+        priceLevel: undefined, // 价格级别
+        productBrandSn: undefined, // 品牌
+        productTypeSn1: undefined, // 产品一级分类
+        productTypeSn2: undefined, // 产品二级分类
+        productTypeSn3: undefined, // 产品三级分类
+        dealerName: ''// 经销商名称
       },
-      showBtns: true,
-      expandAll: false,
-      hasData: false
+      showBtns: true, // 是否显示操作按钮
+      expandAll: false, // 显示展开全部  收起全部按钮
+      hasData: false // 列表数据是否为空
     }
   },
   computed: {
+    // 判断是否显示特约经销商内容
     isTeyue () {
       return this.detail && this.detail.dealerLevel == 'SPECIAL'
     }
@@ -114,6 +123,7 @@ export default {
     handleBack () {
       this.$router.push({ name: 'merchantInfoManagementList', query: { closeLastOldTab: true } })
     },
+    // 获取列表数据
     loadList (list) {
       this.showBtns = this.isTeyue ? list.length == 0 : true
       this.hasData = list.length > 0
@@ -140,6 +150,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : undefined
       this.queryParam.productTypeSn3 = val[2] ? val[2] : undefined
     },
+    // 收起全部 展开全部 事件
     expandAllRow () {
       if (this.expandAll) {
         this.$refs.categoryList.foldAll()
@@ -148,6 +159,7 @@ export default {
       }
       this.expandAll = !this.expandAll
     },
+    // 差价设置成功,关闭弹窗,初始化弹窗所需数据
     resetGetData () {
       this.expandAll = false
       this.$refs.categoryList.dataSource = []
@@ -192,6 +204,7 @@ export default {
         this.spinning = false
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.getDetail()
@@ -199,6 +212,7 @@ export default {
         _this.setTableH()
       })
     },
+    // 获取表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - (!this.showBtns ? 50 : 205)

+ 33 - 15
src/views/dealerManagement/rebateBinding/priceDiffModal.vue

@@ -12,7 +12,7 @@
     <a-spin :spinning="spinning" tip="Loading...">
       <div style="min-height:100px;">
         <a-form-model
-          id="dealerAccountEdit-form"
+          id="priceDifference-form"
           ref="ruleForm"
           :model="form"
           :rules="rules"
@@ -26,19 +26,21 @@
             <a-row :gutter="10">
               <a-col :span="17">
                 <custList
+                  id="priceDifference-custList"
                   v-if="!form.dealerUpsSn || isSpecial"
                   ref="custList"
                   :notDealerSn="notDealer"
                   :notDealerType="['SPECIAL']"
                   @change="custSupChange"
                   placeholder="请输入经销商名称搜索"></custList>
-                <a-input v-else :value="superDealerName" disabled />
+                <a-input id="priceDifference-superDealerName" v-else :value="superDealerName" disabled />
               </a-col>
               <a-col :span="4" v-if="!isSpecial">
                 <a-input-number
                   :precision="2"
                   :min="0"
                   :max="100"
+                  id="priceDifference-parentAllotRate"
                   v-model="parentAllotRate"
                   @change="rateSupChange"
                   placeholder="请输入比例"/> %
@@ -47,6 +49,7 @@
                 <a-button
                   type="primary"
                   ghost
+                  id="priceDifference-zdDealearList"
                   @click="addItem()"
                 >添加指定</a-button>
               </a-col>
@@ -55,13 +58,14 @@
           <a-form-model-item label="指定经销商" v-if="zdDealearList.length">
             <a-row :gutter="10" v-for="(item,index) in zdDealearList" :key="item.id">
               <a-col :span="17">
-                <custList :ref="'custList-'+item.id" :notDealerSn="notZdDealer" @change="(v,r)=>custChange(v,r,index)" placeholder="请输入经销商名称搜索"></custList>
+                <custList id="priceDifference-notZdDealer" :ref="'custList-'+item.id" :notDealerSn="notZdDealer" @change="(v,r)=>custChange(v,r,index)" placeholder="请输入经销商名称搜索"></custList>
               </a-col>
               <a-col :span="4">
                 <a-input-number
                   :precision="2"
                   :min="0"
                   :max="100"
+                  id="priceDifference-allotRate"
                   v-model="item.allotRate"
                   @change="(v)=>rateChange(v,index)"
                   placeholder="请输入比例"/> %
@@ -80,6 +84,7 @@
                   type="primary"
                   title="删除"
                   size="small"
+                  id="priceDifference-del"
                   shape="circle"
                   ghost
                   icon="minus"/>
@@ -89,13 +94,14 @@
           <a-form-model-item label="箭冠总公司" v-if="!isSpecial">
             <a-row :gutter="10">
               <a-col :span="17">
-                <a-input value="箭冠总公司" disabled />
+                <a-input id="priceDifference-headOffice" value="箭冠总公司" disabled />
               </a-col>
               <a-col :span="4">
                 <a-input-number
                   :precision="2"
                   :min="0"
                   :max="100"
+                  id="priceDifference-hAllotRate"
                   v-model="hAllotRate"
                   @change="rateHChange"
                   placeholder="请输入比例"/> %
@@ -108,9 +114,10 @@
         <categoryTree v-if="showTable&&!isSpecial&&!form.dealerUpsSn" ref="categoryTree"></categoryTree>
       </div>
       <div class="btn-cont">
-        <a-button @click="isShow = false" style="font-size: 12px;">取消</a-button>
+        <a-button id="priceDifference-cancel-btn" @click="isShow = false" style="font-size: 12px;">取消</a-button>
         <a-button
           type="primary"
+          id="priceDifference-save-btn"
           style="margin-left: 20px;"
           @click="handleSave"
         >确定</a-button>
@@ -121,10 +128,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import custList from '@/views/common/custList.vue'
 import { VSelect } from '@/components'
-import { dealerUpsCreate, dealerUpsUpdate } from '@/api/dealer'
 import categoryTree from './categoryTree'
+// 接口
+import { dealerUpsCreate, dealerUpsUpdate } from '@/api/dealer'
 export default {
   name: 'PriceDiffModal',
   mixins: [commonMixin],
@@ -139,38 +148,44 @@ export default {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      title: '差价设置',
+      title: '差价设置', // 标题
+      // 表单label布局设置
       formItemLayout: {
         labelCol: { span: 3 },
         wrapperCol: { span: 20 }
       },
+      // 提交参数
       form: {
-        dealerSn: undefined,
-        dealerUpsSn: undefined,
+        dealerSn: undefined, // 经销商sn
+        dealerUpsSn: undefined, // 上级经销商
         rebateParentType: [], // 差价归属
         rebateDealerList: [], // 经销商列表
         rebateScopeList: [] // 品类列表
       },
       parentAllotRate: '', // 上级经销商分配比例
       hAllotRate: '', // 总部分配比例
+      // 表单规则验证
       rules: {
         rebateParentType: [{ required: true, message: '请选择差价归属方', trigger: 'change' }]
       },
-      cjgsfList: [],
-      zdDealearList: [],
-      detailData: null,
-      superDealerName: '',
-      checkedDealerSn: [],
-      showTable: false
+      cjgsfList: [], // 箭冠总公司列表
+      zdDealearList: [], // 指定经销商列表
+      detailData: null, // 详情数据
+      superDealerName: '', // 经销商数据
+      checkedDealerSn: [], // 选中经销商sn
+      showTable: false// 是否显示品牌分类列表
     }
   },
   computed: {
+    // 是否是特约经销商
     isSpecial () {
       return this.detailData && this.detailData.dealerLevel == 'SPECIAL'
     },
+    // 上级经销商数据
     notDealer () {
       return this.form.rebateDealerList.concat(this.zdDealearList).concat([{ 'parentDealerSn': this.form.dealerSn }])
     },
+    // 指定经销商列表数据
     notZdDealer () {
       return this.form.rebateDealerList.concat(this.zdDealearList)
     }
@@ -254,6 +269,7 @@ export default {
         })
       }
     },
+    // 上级经销商 比例 change
     rateSupChange (val) {
       this.form.rebateDealerList[0]['allotRate'] = val
     },
@@ -265,6 +281,7 @@ export default {
         this.$refs.categoryTree.pageInit(this.detailData, parentDealerSn, this.form.dealerSn)
       }
     },
+    // 箭冠总公司  比例
     rateHChange (val) {
       this.form.rebateDealerList[1]['allotRate'] = val
     },
@@ -273,6 +290,7 @@ export default {
       console.log(val, index)
       this.zdDealearList[index]['parentDealerSn'] = val.key
     },
+    // 指定经销商  比例
     rateChange (val, index) {
       console.log(val, index)
       this.zdDealearList[index]['allotRate'] = val

+ 45 - 27
src/views/dowloadFile/list.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-card size="small" :bordered="false" class="noticeManagementList-wrap">
+  <a-card size="small" :bordered="false" class="dowloadFIle-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
@@ -7,29 +7,35 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+                <a-range-picker
+                  id="dowloadFIle-beginDate"
+                  showTime
+                  :disabled-date="disabledDate"
+                  v-model="time"
+                  format="YYYY-MM-DD HH:mm:ss"
+                  @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="文件名称">
-                <a-input id="noticeManagementList-fileName" v-model.trim="queryParam.fileName" allowClear placeholder="请输入文件名称"/>
+                <a-input id="dowloadFIle-fileName" v-model.trim="queryParam.fileName" allowClear placeholder="请输入文件名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="状态">
-                <v-select code="EXPORT_TASK_STATE" id="noticeManagementList-taskState" v-model="queryParam.taskState" allowClear placeholder="请选择状态"></v-select>
+                <v-select code="EXPORT_TASK_STATE" id="dowloadFIle-taskState" v-model="queryParam.taskState" allowClear placeholder="请选择状态"></v-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="noticeManagementList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="noticeManagementList-reset">重置</a-button>
+              <a-button type="primary" @click="searchForm" :disabled="disabled" id="dowloadFIle-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="dowloadFIle-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form>
       </div>
       <!-- 总计 -->
       <a-alert type="info" style="margin-bottom:10px">
-        <div slot="message">注意:所有文件只保留7天,超过7天后,状态变为过期,不能下载</div>
+        <div slot="message">注意:所有文件只保留7天,超过7天后,不能下载</div>
       </a-alert>
       <!-- 列表 -->
       <s-table
@@ -45,7 +51,7 @@
         bordered>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <a :href="record.fileUrl" style="padding: 5px 0 0 23px;display: block;" v-if="record.taskState=='SUCCESS'">下载文件</a>
+          <a :id="'file-'+record.id" :href="record.fileUrl" style="padding: 5px 0 0 23px;display: block;" v-if="record.taskState=='SUCCESS'">下载文件</a>
           <span v-else>--</span>
         </template>
       </s-table>
@@ -54,23 +60,30 @@
 </template>
 
 <script>
+import moment from 'moment'
 import { commonMixin } from '@/utils/mixin'
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import { taskList, dowloadFile } from '@/api/dowloadFile'
-import rangeDate from '@/views/common/rangeDate.vue'
 export default {
   name: 'DowloadFile',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect },
   data () {
+    const startDate = moment(getDate.getRecentTime().starttime).subtract('days', 1).format('YYYY-MM-DD HH:mm:ss')
     return {
       spinning: false,
       tableHeight: 0,
+      // 默认时间
+      time: [
+        startDate,
+        getDate.getRecentTime().endtime
+      ],
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        fileName: '',
-        taskState: undefined
+        beginDate: startDate, // 开始时间
+        endDate: getDate.getRecentTime().endtime, // 结束时间
+        fileName: '', // 文件名称
+        taskState: undefined // 状态
       },
       disabled: false, //  查询、重置按钮是否可操作
       columns: [
@@ -92,7 +105,7 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               const furl = data.list[i].fileUrl
-              data.list[i].fileUrl = furl ? furl.replace('http:',location.protocol) : ''
+              data.list[i].fileUrl = furl ? furl.replace('http:', location.protocol) : ''
             }
             this.total = data.count || 0
             this.disabled = false
@@ -108,36 +121,41 @@ export default {
     }
   },
   methods: {
+    // 禁用时间
+    disabledDate (current) {
+      return current && (current < moment(getDate.getRecentTime().starttime).subtract('days', 2) || current > moment().endOf('day'))
+    },
+    // 下载文件
     dowloadExcel (url) {
       dowloadFile(url, '')
-      // const elt = document.createElement('a')
-      // elt.setAttribute('href', url)
-      // elt.setAttribute('download', '')
-      // elt.style.display = 'none'
-      // document.body.appendChild(elt)
-      // elt.click()
-      // document.body.removeChild(elt)
     },
     //  时间  change
-    dateChange (date) {
-      this.queryParam.beginDate = date[0] ? date[0] : ''
-      this.queryParam.endDate = date[1] ? date[1] : ''
+    dateChange (date, dateString) {
+      this.queryParam.beginDate = dateString[0] ? moment(dateString[0]).format('YYYY-MM-DD HH:mm:ss') : ''
+      this.queryParam.endDate = dateString[1] ? moment(dateString[1]).format('YYYY-MM-DD HH:mm:ss') : ''
+    },
+    // 查询
+    searchForm () {
+      this.$refs.table.refresh(true)
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.beginDate = null
-      this.queryParam.endDate = null
+      this.time = [moment(getDate.getRecentTime().starttime).subtract('days', 1).format('YYYY-MM-DD HH:mm:ss'), getDate.getRecentTime().endtime]
+      this.queryParam.beginDate = moment(getDate.getRecentTime().starttime).subtract('days', 1).format('YYYY-MM-DD HH:mm:ss')
+      this.queryParam.endDate = getDate.getRecentTime().endtime
       this.queryParam.fileName = ''
       this.queryParam.type = undefined
       this.queryParam.taskState = undefined
       this.$refs.table.refresh(true)
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 表格高度计算
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 235

+ 24 - 14
src/views/expenseManagement/expenseReimbursement/add.vue

@@ -4,10 +4,10 @@
       <a-page-header :ghost="false" :backIcon="false" class="expenseReimbursementAddcont" >
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
-          <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack(0)"><a-icon type="left" /> 返回列表</a>
+          <a id="expenseEdit-back-btn" href="javascript:;" @click="handleBack(0)"><a-icon type="left" /> 返回列表</a>
           <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailData&&detailData.expenseAccountNo }}</span>
           <span style="margin: 0 10px;color: #666;">申请人:{{ detailData&&detailData.applyPersonName || '--' }}</span>
-          <a-button size="small" type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button size="small" type="link" class="button-default" id="expenseEdit-showdesc" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -15,7 +15,7 @@
       <a-card :bordered="false" size="small" class="expenseReimbursementAddcont" v-show="showDetail">
         <div slot="title">
           <span>基础信息</span>
-          <div style="cursor:pointer;color: #00aaff;float:right;" @click.stop="handleEditBase" >
+          <div style="cursor:pointer;color: #00aaff;float:right;" id="expenseEdit-showEditModal" @click.stop="handleEditBase" >
             <a-icon type="edit" /> 编辑基础信息
           </div>
         </div>
@@ -33,7 +33,13 @@
           <a-descriptions-item label="主题" :span="3">{{ detailData&&detailData.title || '--' }}</a-descriptions-item>
           <a-descriptions-item label="详细说明" :span="3">{{ detailData&&detailData.content.join(',')||'' }}</a-descriptions-item>
           <a-descriptions-item label="附件" :span="3">
-            <a target="_blank" style="color: #00aaff;text-decoration: underline;margin-right: 15px;" :href="item.filePath" v-for="item in detailData.expenseAccountFilesList" :key="item.id">
+            <a
+              target="_blank"
+              style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
+              :href="item.filePath"
+              v-for="item in detailData.expenseAccountFilesList"
+              :id="item.id"
+              :key="item.id">
               {{ item.fileName }}
             </a>
           </a-descriptions-item>
@@ -45,9 +51,9 @@
           <div style="display: flex;justify-content: space-between;align-items: center;">
             <div>费用明细</div>
             <div>
-              <a-button size="small" class="button-info" type="primary" @click="plEdit">变更记账名称</a-button>
-              <a-button size="small" class="button-info" type="primary" @click="openGuideModal=true">导入费用明细</a-button>
-              <a-button size="small" class="button-error" type="primary" @click="newExpenseDetail">新增费用明细</a-button>
+              <a-button id="expenseEdit-plEdit" size="small" class="button-info" type="primary" @click="plEdit">变更记账名称</a-button>
+              <a-button id="expenseEdit-import" size="small" class="button-info" type="primary" @click="openGuideModal=true">导入费用明细</a-button>
+              <a-button id="expenseEdit-new" size="small" class="button-error" type="primary" @click="newExpenseDetail">新增费用明细</a-button>
             </div>
           </div>
         </div>
@@ -75,18 +81,21 @@
               type="link"
               class="button-info"
               @click="setProduct(record)"
+              :id="'expenseEdit-set-'+record.id"
             >设置产品信息</a-button>
             <a-button
               size="small"
               type="link"
               class="button-info"
               @click="handleEdit(record)"
+              :id="'expenseEdit-edit-'+record.id"
             >编辑</a-button>
             <a-button
               size="small"
               type="link"
               class="button-error"
               @click="handleDel(record)"
+              :id="'expenseEdit-del-'+record.id"
             >删除</a-button>
           </template>
           <!-- 记账名称 -->
@@ -178,15 +187,15 @@ export default {
     const _this = this
     return {
       spinning: false,
-      detailData: null,
-      openBaseModal: false,
-      openGuideModal: false,
-      openDepartUserModal: false,
+      detailData: null, // 详情信息
+      openBaseModal: false, // 基础信息编辑弹框
+      openGuideModal: false, // 导入费用明细弹框
+      openDepartUserModal: false, // 选择审核人员弹框
       openEpenseDetailModal: false, // 费用明细弹框
-      expenseAccountDetailSn: '',
+      expenseAccountDetailSn: '', // 费用明细sn
       openProductInfoModal: false, // 产品信息弹框
-      showDetail: false,
-      total: 0,
+      showDetail: false, // 是否显示详细信息
+      total: 0, // 总记录数
       loadData: parameter => {
         const params = Object.assign(parameter, { expenseAccountSn: this.$route.params.sn })
         return expenseAcctDetailFindList(params).then(res => {
@@ -401,6 +410,7 @@ export default {
     handleBack (data) {
       this.$router.push({ name: 'expenseReimbursementList' })
     },
+    // 初始化页面
     pageInit () {
       this.$refs.table.clearTable()
       if (this.$route.params.sn) { //  编辑页

+ 29 - 21
src/views/expenseManagement/expenseReimbursement/baseDataModal.vue

@@ -20,18 +20,18 @@
         <a-row>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="申请人" prop="applyPersonSn">
-              <employee style="width: 100%;" @change="employeeChange" id="expenseReimbursement-Employee" v-model="form.applyPersonSn"></employee>
+              <employee style="width: 100%;" @change="employeeChange" id="expenseReimbursementAddform-Employee" v-model="form.applyPersonSn"></employee>
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="申请部门" prop="applyDepartmentSn">
-              <department style="width: 100%;" @change="departementChange" id="expenseReimbursement-Department" v-model="form.applyDepartmentSn"></department>
+              <department style="width: 100%;" @change="departementChange" id="expenseReimbursementAddform-Department" v-model="form.applyDepartmentSn"></department>
             </a-form-model-item>
           </a-col>
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="费用类型" prop="expenseType">
               <expenseType
-                id="expenseReimbursement-expenseType"
+                id="expenseReimbursementAddform-expenseType"
                 v-model="expenseTypes"
                 @change="expenseChange"
                 placeholder="请选择费用类型"
@@ -41,6 +41,7 @@
           <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
             <a-form-model-item label="费用产生月" prop="expenseDate">
               <a-month-picker
+                id="expenseReimbursementAddform-expenseDate"
                 placeholder="请选择月份"
                 v-model="form.expenseDate"
                 locale="zh-cn"
@@ -52,7 +53,7 @@
           <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
             <a-form-model-item label="主题" prop="title" :label-col="{span:3}" :wrapper-col="{span:19}">
               <a-textarea
-                id="expenseReimbursementAdd-title"
+                id="expenseReimbursementAddform-title"
                 :maxLength="100"
                 :rows="3"
                 v-model.trim="form.title"
@@ -63,7 +64,7 @@
           <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
             <a-form-model-item label="详细说明" prop="content" :label-col="{span:3}" :wrapper-col="{span:19}">
               <a-textarea
-                id="expenseReimbursementAdd-content"
+                id="expenseReimbursementAddform-content"
                 placeholder="请详细描述费用报销内容(最多500个字符)"
                 v-model.trim="form.content"
                 :rows="3"
@@ -77,7 +78,7 @@
             <a-form-model-item label="附件" help="(支持图片、word、excel、PDF等格式,最多10个附件)" :label-col="{span:3}" :wrapper-col="{span:19}">
               <Upload
                 style="height: 100%;"
-                id="noticeEdit-attachList"
+                id="expenseReimbursementAddform-attachList"
                 v-model="form.expenseAccountFilesList"
                 ref="attachList"
                 :fileSize="10"
@@ -91,8 +92,8 @@
           </a-col>
         </a-row>
         <div style="text-align: center;margin-top: 20px;">
-          <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
-          <a-button type="primary" :loading="spinning" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+          <a-button @click="cancel" style="margin-right: 15px" id="expenseReimbursementAddform-btn-back">取消</a-button>
+          <a-button type="primary" :loading="spinning" @click="handleSubmit" id="expenseReimbursementAddform-btn-submit">保存</a-button>
         </div>
       </a-form-model>
     </a-spin>
@@ -119,17 +120,17 @@ export default {
   data () {
     return {
       opened: this.show,
-      expenseAccountSn: this.itemSn,
+      expenseAccountSn: this.itemSn, // 费用报销单sn
       spinning: false,
-      title: '新增费用报销单',
+      title: '新增费用报销单', // 弹框标题
       formItemLayout: {
         labelCol: { span: 6 },
         wrapperCol: { span: 14 }
       },
-      fromPage: null,
-      attachList: [],
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
-      expenseTypes: [],
+      fromPage: null, // 打开方式,sales:销售单转费用单,salesMearge:合并销售单转,其它手动创建
+      attachList: [], // 附件列表
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo', // 附件上传地址
+      expenseTypes: [], // 费用类型值
       form: {
         applyPersonSn: undefined, // 申请人
         applyDepartmentSn: undefined, //  申请部门
@@ -166,10 +167,12 @@ export default {
     }
   },
   methods: {
+    // 关闭弹框
     cancel () {
       this.spinning = false
       this.$emit('close')
     },
+    // 初始化
     pageInit () {
       this.$nextTick(() => {
         if (this.expenseAccountSn) { //  编辑页
@@ -180,6 +183,7 @@ export default {
         }
       })
     },
+    // 重置表单
     retsetForm () {
       this.form = {
         applyPersonSn: undefined, // 申请人
@@ -209,19 +213,22 @@ export default {
         this.$refs.ruleForm.validateField(['applyPersonSn', 'applyDepartmentSn'])
       })
     },
+    // 申请部门选择
     departementChange () {
       this.$nextTick(() => {
         this.$refs.ruleForm.validateField('applyDepartmentSn')
       })
     },
+    // 费用产生月
     expenseDateChange (v, d) {
       this.form.expenseDate = d
     },
+    // 费用产生月禁止范围
     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] : ''
@@ -238,9 +245,8 @@ export default {
         item.fileType = item.extName
       })
     },
-    // 设置数据
+    // 编辑时设置数据
     setDetail (data, from) {
-      console.log(data)
       this.spinning = false
       this.disabled = false
       this.fromPage = from
@@ -255,7 +261,7 @@ export default {
         this.expenseTypes = data.expenseType ? [this.form.expenseType, this.form.expenseType2, this.form.expenseType3] : []
       }, 500)
     },
-    //  详情
+    //  获取详情
     getDetail () {
       this.spinning = true
       this.disabled = true
@@ -278,14 +284,15 @@ export default {
           const form = JSON.parse(JSON.stringify(_this.form))
           form.expenseDate = form.expenseDate + '-01'
           form.expenseAccountFilesList = this.attachList
-          console.log(form)
+          // console.log(form)
           _this.spinning = true
-          // 从销售单转的费用
+
+          // 从销售单转的费用,直接提交
           if (_this.fromPage == 'sales') {
             _this.$emit('expenseSaveOk', form, this.fromPage)
             return false
           }
-          // 从销售单转的费用,合并提交
+          // 从销售单转的费用,合并提交
           if (_this.fromPage == 'salesMearge') {
             _this.$emit('expenseSaveOk', form, this.fromPage)
             return false
@@ -298,6 +305,7 @@ export default {
                 if (this.expenseAccountSn) {
                   _this.$emit('refashData')
                 } else {
+                  // 跳转到费用明细单页面
                   _this.$router.push({ name: 'expenseReimbursementEdit', params: { sn: res.data.expenseAccountSn } })
                 }
                 _this.spinning = false

+ 12 - 8
src/views/expenseManagement/expenseReimbursement/chooseDepartUserModal.vue

@@ -46,7 +46,7 @@
         </div>
         <div class="btn-cont">
           <a-button id="departUser-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
-          <a-button :loading="uploading" style="margin-right: 15px;" @click="updateUser">刷新人员</a-button>
+          <a-button id="departUser-refash" :loading="uploading" style="margin-right: 15px;" @click="updateUser">刷新人员</a-button>
           <a-button type="primary" id="departUser-save" @click="handleSave">确定</a-button>
         </div>
       </div>
@@ -67,7 +67,7 @@ export default {
       type: Boolean,
       default: false
     },
-    type: {
+    type: { // 类型
       type: String,
       default: ''
     },
@@ -101,17 +101,19 @@ export default {
     }
   },
   methods: {
+    // 刷新人员数据
     updateUser () {
       this.uploading = true
       this.$refs.departUserApp.updateDeptUser()
       // this.$refs.departUserCc.updateDeptUser()
     },
+    // 选择人员
     changeApprovers (value) {
       this.form.approvers = value
       this.$refs.ruleForm.clearValidate()
     },
+    // 获取人员组织树数据
     getTreeVal (data) {
-      console.log(data)
       const ret = []
       data.map(item => {
         ret.push(item.value)
@@ -131,7 +133,6 @@ export default {
           if (form.ccList) {
             form.ccList = this.getTreeVal(form.ccList)
           }
-          console.log(form)
           this.$emit('submit', form)
           this.$emit('close')
         } else {
@@ -139,6 +140,7 @@ export default {
         }
       })
     },
+    // 格式化人员数据
     getFormatUser (list) {
       const ret = []
       list.map(item => {
@@ -146,16 +148,16 @@ export default {
       })
       return ret
     },
+    // 获取默认人员选项
     async getDefAudit () {
-      // 费用单''   提货单'billOfLading'   财务单'financeOrder'
+      // 费用单时 type = ''
       if (!this.type) {
         // 默认写死的人员
         const data = await getDefaultCofig({ code: 'EXPENSE_ACCOUNT_DING_USER' }).then(res => res.data)
         const ret = JSON.parse(data.value)
-        console.log(ret)
         this.form.approvers = this.getFormatUser(ret.approvers)
         this.form.ccList = this.getFormatUser(ret.ccList)
-      } else if (this.type && this.type == 'financeOrder') {
+      } else if (this.type && this.type == 'financeOrder') { // 财务单 type = 'financeOrder'
         // 取最新一次审核通过值
         const data = await queryLastFinishDingUser().then(res => res.data)
         if (data.approversTaskList) {
@@ -164,7 +166,8 @@ export default {
         if (data.ccTaskList) {
           this.form.ccList = this.getFormatUser(data.ccTaskList)
         }
-      } else if (this.type && this.type == 'billOfLading') {
+      } else if (this.type && this.type == 'billOfLading') { // 提货单 type = 'billOfLading'
+        // 取最新一次审核通过值
         const data = await getFinishDingUser().then(res => res.data)
         if (data.approversTaskList) {
           this.form.approvers = this.getFormatUser(data.approversTaskList)
@@ -174,6 +177,7 @@ export default {
         }
       }
     },
+    // 重置
     resetForm () {
       this.$nextTick(() => {
         this.$refs.ruleForm.resetFields()

+ 7 - 2
src/views/expenseManagement/expenseReimbursement/chooseImportModal.vue

@@ -125,6 +125,7 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 正确列表
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '记账类型', dataIndex: 'importAccountType', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -138,6 +139,7 @@ export default {
         { title: '产品信息', scopedSlots: { customRender: 'cpxx' }, align: 'center', width: '15%' }
       ],
       loadData: [],
+      // 错误数据列表
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
         { title: '记账类型', dataIndex: 'importAccountType', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -156,7 +158,7 @@ export default {
     }
   },
   methods: {
-    // 格式化数据
+    // 格式化产品数据
     formatProduct (list) {
       const ret = []
       list.map(item => {
@@ -169,6 +171,7 @@ export default {
       })
       return ret
     },
+    // 格式化承担人员数据
     formatSplit (list) {
       const ret = []
       list.map(item => {
@@ -185,6 +188,7 @@ export default {
             })
           })
         } else {
+          // 没有承担人员
           ret.push({
             splitObjName: item.importSplitObjName,
             splitObjType: item.importSplitObjType,
@@ -194,6 +198,7 @@ export default {
       })
       return ret
     },
+    // 获取数据
     getData () {
       const paramsData = JSON.parse(JSON.stringify(this.paramsData))
       this.loadData = paramsData.rightList || []
@@ -227,7 +232,7 @@ export default {
         this.isShow = false
       }
     },
-    // 导出
+    // 导出错误项
     handleError () {
       const _this = this
       if (_this.paramsData.errorList.length < 1) {

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

@@ -138,11 +138,10 @@ export default {
     return {
       spinning: false,
       disabled: false,
-      baseData: null,
-      showTipModal: false,
-      showDetail: false,
-      printType: '',
-      count: 0,
+      showTipModal: false, // 费用报销单打印预览弹框
+      showDetail: false, // 是否显示详细信息
+      printType: '', // 打印类型
+      count: 0, // 费用明细条数
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '记账类型', dataIndex: 'accountTypeDictValue', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
@@ -177,12 +176,12 @@ export default {
         })
       },
       detailData: null, // 详情数据
-      total: 0,
+      total: 0, // 总条数
       printRemark: false // 是否打印备注
     }
   },
   methods: {
-    //  返回
+    //  返回列表
     handleBack () {
       this.$router.push({ name: 'expenseReimbursementList' })
     },
@@ -198,6 +197,7 @@ export default {
       if (type == 'preview') {
         this.showTipModal = true
       }
+      // 设置打印内容
       this.$nextTick(() => {
         this.$refs.printModal.setData([{
           printRemark: this.printRemark,
@@ -231,7 +231,7 @@ export default {
         this.spinning = false
       }
     },
-    //  详情
+    //  详情信息
     getDetail () {
       this.spinning = true
       this.detailData = null

+ 27 - 8
src/views/expenseManagement/expenseReimbursement/epenseCdfModal.vue

@@ -20,6 +20,7 @@
             <!-- 费用承担方类型 -->
             <template slot="fycdftype" slot-scope="text,record,index">
               <v-select
+                :id="'cdfTable-splitObjType-'+index"
                 code="EXPENSE_ACCOUNT_DETAIL_SPLIT_OBJ_TYPE"
                 allowClear
                 style="width: 100%;"
@@ -32,7 +33,7 @@
             <!-- 费用承担方 -->
             <template slot="fycdf" slot-scope="text,record,index">
               <!-- 部门 -->
-              <department v-show="record.splitObjType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择承担方" v-model="record.splitObjSn"></department>
+              <department :id="'cdfTable-department-'+index" v-show="record.splitObjType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择承担方" v-model="record.splitObjSn"></department>
               <!-- 经销商 -->
               <custList
                 v-show="record.splitObjType=='CUSTOMER'"
@@ -46,19 +47,22 @@
                 v-show="record.splitObjType=='SUPPLIER'"
                 style="width: 100%;"
                 enableFlag="1"
+                :id="'cdfTable-supplier-'+index"
                 v-model="record.splitObjSn"
                 placeholder="请选择(输入名称搜索)"></supplier>
               <!-- 其它往来 -->
-              <otherTransactions 
-              style="width: 100%;"
-              v-show="record.splitObjType=='OTHER_ORG'" 
-              v-model="record.splitObjSn" 
-              placeholder="请选择(输入名称搜索)"></otherTransactions>
+              <otherTransactions
+                style="width: 100%;"
+                :id="'cdfTable-otherTransactions-'+index"
+                v-show="record.splitObjType=='OTHER_ORG'"
+                v-model="record.splitObjSn"
+                placeholder="请选择(输入名称搜索)"></otherTransactions>
               <span v-if="!record.splitObjType">--</span>
             </template>
             <!-- 费用承担金额 -->
             <template slot="amount" slot-scope="text,record,index">
               <a-input-number
+                :id="'cdfTable-splitAmount-'+index"
                 v-show="record.splitObjType"
                 style="width: 100%;"
                 v-model="record.splitAmount"
@@ -75,10 +79,12 @@
               <div
                 style="display: flex;align-items: center;width: 100%;padding: 5px 0;border-bottom: 1px solid #eee;"
                 v-for="(item,idx) in record.childDetailSplitList"
+                :id="item.id"
                 :key="item.id">
                 <employee style="width: 40%;" placeholder="请选择承担人员" v-model="item.splitObjSn"></employee>
                 -
                 <a-input-number
+                  :id="'cdfTable-childsplitAmount-'+index"
                   style="width: 40%;"
                   v-model="item.splitAmount"
                   :precision="2"
@@ -89,6 +95,7 @@
                 <div style="padding-left: 15px;" v-if="record.childDetailSplitList&&record.childDetailSplitList.length>1">
                   <a-button
                     @click="handleDelCdry(record,idx)"
+                    :id="'cdfTable-childsplitAmoun-del-'+index"
                     title="删除"
                     size="small"
                     type="danger"
@@ -98,6 +105,7 @@
                 <div v-if="record.childDetailSplitList&&idx == record.childDetailSplitList.length - 1">
                   <a-button
                     @click="handleAddCdry(record,idx)"
+                    :id="'cdfTable-childsplitAmoun-add-'+index"
                     title="添加承担人员"
                     size="small"
                     type="primary"
@@ -110,6 +118,7 @@
             </template>
             <template slot="action" slot-scope="text,record,index">
               <a-button
+                :id="'cdfTable-del-'+index"
                 size="small"
                 type="link"
                 class="button-error"
@@ -118,6 +127,7 @@
             </template>
             <template slot="footer" slot-scope="currentPageData">
               <a-button
+                :id="'cdfTable-add-'+index"
                 type="link"
                 class="button-info"
                 block
@@ -148,10 +158,12 @@ export default {
     }
   },
   watch: {
+    // 费用明细列表
     list (newValue, oldValue) {
       this.dataList = JSON.parse(JSON.stringify(newValue))
       this.dataList.map(item => {
         item.no = item.id
+        // 部门
         if (item.splitObjType == 'DEPARTMENT' && (!item.childDetailSplitList || item.childDetailSplitList.length == 0)) {
           this.$set(item, 'childDetailSplitList', [{
             splitObjType: 'EMPLOYEE',
@@ -159,12 +171,14 @@ export default {
             splitAmount: 0
           }])
         }
+        // 客户
         if (item.splitObjType == 'CUSTOMER') {
           this.$nextTick(() => {
             this.$refs['custList-' + item.no].setDufaultVal(item.splitObjName)
           })
         }
       })
+      // 默认添加一条
       if (this.dataList.length == 0) {
         this.handleAddRow()
       }
@@ -198,24 +212,27 @@ export default {
         splitObjSn: undefined,
         splitAmount: Number(row.splitAmount).toFixed(2)
       }] : [])
+      // 客户
       if (row.splitObjType == 'CUSTOMER') {
         this.$set(row, 'splitObjSn', undefined)
         this.$set(row, 'splitObjName', undefined)
         this.$refs['custList-' + row.no].dealerName = []
       }
+      // 供应商
       if (row.splitObjType == 'SUPPLIER') {
         this.$set(row, 'splitObjSn', undefined)
       }
+      // 费用合计
       this.$emit('fyTotal', this.fyTotal())
     },
-    // 经销商
+    // 选择经销商
     custChange (v, obj, id) {
       const row = this.dataList[id.split('-')[1]]
       this.$set(row, 'splitObjSn', v.key)
       this.$set(row, 'splitObjName', obj.dealerName)
       this.$emit('fyTotal', this.fyTotal())
     },
-    // 承担费用
+    // 选择承担费用
     splitAmountChange () {
       this.$emit('fyTotal', this.fyTotal())
     },
@@ -232,6 +249,7 @@ export default {
         hasError = 1
       } else {
         ret.map(item => {
+          // 如果时部门
           if (item.splitObjType == 'DEPARTMENT') {
             const al = item.childDetailSplitList.filter(a => !a.splitObjSn && a.splitAmount > 0)
             if (al.length) {
@@ -317,6 +335,7 @@ export default {
         }
       })
     },
+    // 费用合计计算
     fyTotal: function () {
       let total = 0
       this.dataList.map(item => { total = total + item.splitAmount })

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

@@ -77,7 +77,7 @@
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
                 <a-form-model-item label="所属省份" prop="provinceSn">
-                  <Area id="epenseDetailModal-area" @change="provinceChange" placeholder="请选择所属省份" v-model="form.provinceSn"></Area>
+                  <Area id="epenseDetailModal-provinceSn" @change="provinceChange" placeholder="请选择所属省份" v-model="form.provinceSn"></Area>
                 </a-form-model-item>
               </a-col>
             </a-row>
@@ -85,7 +85,7 @@
               <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
                 <a-form-model-item label="所属城市" prop="citySn">
                   <Area
-                    id="epenseDetailModal-area"
+                    id="epenseDetailModal-citySn"
                     ref="city"
                     @change="cityChange"
                     placeholder="请选择所属城市"
@@ -114,7 +114,7 @@
             <a-row>
               <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                 <a-form-model-item label="备注" prop="remarks" :label-col="{span:2}" :wrapper-col="{span:20}">
-                  <a-textarea placeholder="请输入备注(最多500个字符)" v-model="form.remarks" :rows="4" :maxLength="500"/>
+                  <a-textarea id="epenseDetailModal-remarks" placeholder="请输入备注(最多500个字符)" v-model="form.remarks" :rows="4" :maxLength="500"/>
                 </a-form-model-item>
               </a-col>
             </a-row>
@@ -193,7 +193,7 @@ export default {
         expenseAccountSn: '', // 报销单SN
         expenseAccountNo: '', // 报销单号
         expenseAccountDetailSn: '', // 报销明细sn
-        detailSplitList: []
+        detailSplitList: [] // 费用承担方明细
       },
       rules: {
         accountType: [
@@ -343,6 +343,7 @@ export default {
         }
       })
     },
+    // 重置表单
     resetForm () {
       this.$nextTick(() => {
         this.$refs.ruleForm.resetFields()

+ 4 - 6
src/views/expenseManagement/expenseReimbursement/importGuideModal.vue

@@ -17,9 +17,9 @@
           <ul>
             <li>1) 导入的Excel文件中必须包含名为“记账类型”、“记账名称”、“费用承担方类型”、“费用承担方”、“费用承担金额”的列,且名称必须相同</li>
             <li>2) 其他列可根据实际情况填写,如果符合规则,系统会一起导入</li>
-            <li><a :href="filePath" style="margin: 5px 0 0 15px;display: block;">
-            <a-icon type="download" style="padding-right: 5px;" />下载导入模板
-          </a></li>
+            <li><a :href="filePath" id="importGuide-link" style="margin: 5px 0 0 15px;display: block;">
+              <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+            </a></li>
           </ul>
         </div>
         <div class="explain-item">
@@ -90,7 +90,7 @@ export default {
         savePathType: 'local'
       },
       exportLoading: false,
-      filePath: location.protocol + '//' +location.host + '/templ/费用明细模板.xlsx' + '?a=' + new Date().getTime()
+      filePath: location.protocol + '//' + location.host + '/templ/费用明细模板.xlsx' + '?a=' + new Date().getTime() // 模板地址
     }
   },
   methods: {
@@ -109,13 +109,11 @@ export default {
     },
     // 上传文件  change
     changeImport (file) {
-      console.log(file, JSON.parse(file))
       if (file && JSON.parse(file).length > 0) {
         this.paramsData = Object.assign({}, JSON.parse(file)[0] || null, this.params)
       } else {
         this.paramsData = null
       }
-      console.log(this.paramsData)
     },
     // 导入
     hanldeOk (obj) {

+ 74 - 57
src/views/expenseManagement/expenseReimbursement/list.vue

@@ -78,9 +78,9 @@
             </template>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
-                <a-button type="primary" :disabled="disabled" @click="searchForm">查询</a-button>
-                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
-                <a @click="advanced=!advanced" style="margin-left: 8px">
+                <a-button type="primary" :disabled="disabled" @click="searchForm" id="salesManagementList-search">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()" id="salesManagementList-reset">重置</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 8px" id="salesManagementList-advanced">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
                 </a>
@@ -94,9 +94,15 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator">
-          <a-button type="primary" v-if="$hasPermissions('B_eRNew')" @click="handleEdit()">新增</a-button>
-          <a-button type="primary" v-if="$hasPermissions('B_eRPrint')" :loading="spinning" @click="handlePlPrint()" ghost>批量打印</a-button>
-          <a-checkbox v-model="printRemark" v-if="$hasPermissions('B_eRPrint')" id="print-remark">打印备注</a-checkbox>
+          <a-button id="salesManagementList-add" type="primary" v-if="$hasPermissions('B_eRNew')" @click="handleEdit()">新增</a-button>
+          <a-button
+            id="salesManagementList-batchPrint"
+            type="primary"
+            v-if="$hasPermissions('B_eRPrint')"
+            :loading="spinning"
+            @click="handlePlPrint()"
+            ghost>批量打印</a-button>
+          <a-checkbox id="salesManagementList-print-remarks" v-model="printRemark" v-if="$hasPermissions('B_eRPrint')">打印备注</a-checkbox>
           <span style="margin-left: 8px" v-if="$hasPermissions('B_eRPrint')">
             <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
           </span>
@@ -118,7 +124,7 @@
           bordered>
           <!-- 单号 -->
           <template slot="expenseAccountNo" slot-scope="text, record">
-            <span v-if="$hasPermissions('B_eRdetail')" class="link-bule" @click="handleDetail(record)">{{ record.expenseAccountNo }}</span>
+            <span :id="'salesManagementList-detail-'+record.id" v-if="$hasPermissions('B_eRdetail')" class="link-bule" @click="handleDetail(record)">{{ record.expenseAccountNo }}</span>
             <div v-else>{{ record.expenseAccountNo||'--' }}</div>
           </template>
           <!-- 总数量 -->
@@ -131,43 +137,48 @@
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
-            <a-button
-              v-if="record.state=='WAIT_SUBMIT'&&$hasPermissions('B_ERtEdit')"
-              size="small"
-              type="link"
-              class="button-info"
-              @click="handleEdit(record)"
-            >
-              编辑
-            </a-button>
-            <a-button
-              v-if="record.state=='WAIT_SUBMIT'&&$hasPermissions('B_ERDel')"
-              size="small"
-              type="link"
-              class="button-error"
-              @click="handleDel(record)"
-            >
-              删除
-            </a-button>
-            <a-button
-              v-if="record.state!='WAIT_SUBMIT'&&$hasPermissions('B_ERAudit')"
-              size="small"
-              type="link"
-              class="button-info"
-              @click="handleSH(record)"
-            >
-              审核进度
-            </a-button>
-            <a-button
-              v-if="record.state=='AUDIT_REJECT'"
-              size="small"
-              type="link"
-              class="button-info"
-              @click="againEdit(record)"
-            >
-              再次编辑
-            </a-button>
-          <!-- <span v-if="record.state=='AUDIT_REJECT' || record.state=='AUDIT_PASS'">--</span> -->
+            <div>
+              <a-button
+                :id="'salesManagementList-edit-'+record.id"
+                v-if="record.state=='WAIT_SUBMIT'&&$hasPermissions('B_ERtEdit')"
+                size="small"
+                type="link"
+                class="button-info"
+                @click="handleEdit(record)"
+              >
+                编辑
+              </a-button>
+              <a-button
+                :id="'salesManagementList-del-'+record.id"
+                v-if="record.state=='WAIT_SUBMIT'&&$hasPermissions('B_ERDel')"
+                size="small"
+                type="link"
+                class="button-error"
+                @click="handleDel(record)"
+              >
+                删除
+              </a-button>
+              <a-button
+                :id="'salesManagementList-audit-'+record.id"
+                v-if="record.state!='WAIT_SUBMIT'&&$hasPermissions('B_ERAudit')"
+                size="small"
+                type="link"
+                class="button-info"
+                @click="handleSH(record)"
+              >
+                审核进度
+              </a-button>
+              <a-button
+                :id="'salesManagementList-editAge-'+record.id"
+                v-if="record.state=='AUDIT_REJECT'"
+                size="small"
+                type="link"
+                class="button-info"
+                @click="againEdit(record)"
+              >
+                再次编辑
+              </a-button>
+            </div>
           </template>
         </s-table>
       </a-spin>
@@ -217,10 +228,10 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 审核进度弹框是否显示
       openBaseModal: false, // 基础信息新建
-      showTipModal: false,
+      showTipModal: false, // 打印预览组件
       itemSn: '', // 费用单sn
-      tableHeight: 0,
-      expenseTypes: [],
+      tableHeight: 0, // 表格高度
+      expenseTypes: [], // 费用类型
       // 查询参数
       queryParam: {
         expenseDate: moment().format('YYYY-MM'), // 月份
@@ -232,7 +243,7 @@ export default {
         printStatus: undefined, // 打印状态
         state: undefined, // 状态
         salesBillNo: '', // 销售单号
-        bizUserSn: undefined
+        bizUserSn: undefined // 客服
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -283,6 +294,7 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
+    // 打印结束,记录打印状态
     printOk (data) {
       if (data && data.status == 200) {
         const rows = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
@@ -314,10 +326,11 @@ export default {
         _this.$message.warning('请在列表勾选后再进行批量操作!')
         return false
       }
+      // 开始打印
       this.spinning = true
       const pageData = []
       const businessSnList = []
-
+      // 循环获取
       for (let i = 0; i < rows.length; i++) {
         // 费用明细
         const fyListData = await expenseAcctDetailFindList({ expenseAccountSn: rows[i].expenseAccountSn }).then(res => res.data)
@@ -325,6 +338,7 @@ export default {
         if (rows[i].state != 'WAIT_SUBMIT') {
           businessSnList.push(rows[i].expenseAccountSn)
         }
+        // 组装数据
         pageData.push({
           printRemark: this.printRemark,
           expenseInfo: rows[i],
@@ -340,7 +354,6 @@ export default {
           item.spListData = sp ? sp.taskVOList : []
         }
       })
-      console.log(pageData)
       // 打开预览弹框
       this.showTipModal = true
       this.$nextTick(() => {
@@ -348,25 +361,28 @@ export default {
         this.spinning = false
       })
     },
+    // 费用发生月份
     onChange (date, dateString) {
       this.queryParam.expenseDate = dateString
     },
+    // 费用发生月份禁用范围
     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] : ''
       this.queryParam.expenseType3 = val && val[2] ? val[2] : ''
     },
-    // 详情
+    // 详情页面
     handleDetail (row) {
       this.$router.push({ name: 'expenseReimbursementListDetail', params: { sn: row.expenseAccountSn } })
     },
     // 新增、编辑
     handleEdit (row) {
+      // 编辑
       if (row && row.expenseAccountSn) {
         this.$router.push({ name: 'expenseReimbursementEdit', params: { sn: row.expenseAccountSn } })
       } else {
@@ -387,15 +403,13 @@ export default {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
             }
+            _this.spinning = false
           })
         }
       })
     },
-    // 审核进度
+    // 审核进度弹框
     handleSH (row) {
       this.openModal = true
       this.itemSn = row.expenseAccountSn
@@ -420,11 +434,12 @@ export default {
         }
       })
     },
+    // 查询列表
     searchForm () {
       this.$refs.table.refresh(true)
       this.$refs.table.clearSelected()
     },
-    // 重置
+    // 重置列表
     resetSearchForm () {
       this.queryParam = {
         expenseDate: '', // 月份
@@ -442,12 +457,14 @@ export default {
       this.expenseTypes = []
       this.searchForm()
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240

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

@@ -36,6 +36,7 @@
             <div slot="customTitle"><span style="color: red;">*</span>费用金额</div>
             <template slot="action" slot-scope="text,record,index">
               <a-button
+                :id="'productInfoModal-del-'+record.id"
                 size="small"
                 type="link"
                 class="button-error"
@@ -52,17 +53,18 @@
                 style="width: 100%;"
                 :disabled="!!record.productCode"
                 :ref="'productType-'+record.no"
-                :id="'productType-'+index"
+                :id="'productInfoModal-productType-'+record.id"
                 v-model="record.productType"
                 @change="changeProductType"></ProductTypeAll>
             </template>
             <!-- 产品编码 -->
             <template slot="productCode" slot-scope="text,record,index">
-              <productCodeList :ref="'productCode-'+record.no" :key="'productCode-'+index" :id="'productCode-'+index" @change="e => productCodeChange(e, record)" />
+              <productCodeList :ref="'productCode-'+record.no" :key="'productCode-'+index" :id="'productCode-'+record.id" @change="e => productCodeChange(e, record)" />
             </template>
             <!-- 费用金额 -->
             <template slot="expense" slot-scope="text,record">
               <a-input-number
+                :id="'productInfoModal-expense-'+record.id"
                 style="width: 100%;"
                 v-model="record.expense"
                 :precision="2"
@@ -73,6 +75,7 @@
             </template>
             <template slot="footer" slot-scope="currentPageData">
               <a-button
+                :id="'productInfoModal-add-'+record.id"
                 type="link"
                 class="button-info"
                 v-if="dataList.length==0"
@@ -113,7 +116,7 @@ export default {
       type: String,
       default: ''
     },
-    expenseAccountDetailSn: {
+    expenseAccountDetailSn: { // 费用单sn
       type: String,
       default: ''
     }
@@ -123,7 +126,7 @@ export default {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
       dataList: [],
-      baseData: null,
+      baseData: null, // 详细信息
       columns: [
         { title: '产品品牌', scopedSlots: { customRender: 'productBrand' }, align: 'center', width: '20%' },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, align: 'center', width: '30%' },
@@ -136,7 +139,6 @@ export default {
   methods: {
     // 产品编码
     productCodeChange (val, row) {
-      console.log(val, row)
       row.productSn = val.key || undefined
       row.productCode = val.row && val.row.code ? val.row.code : undefined
       row.productName = val.row && val.row.name ? val.row.name : undefined
@@ -163,7 +165,6 @@ export default {
     },
     //  产品分类  change
     changeProductType (val, id, options) {
-      console.log(val, id, options)
       const index = id.split('-')[1]
       const row = this.dataList[index]
       if (val.length > 1) {
@@ -223,10 +224,6 @@ export default {
       // 校验数据
       const retList = JSON.parse(JSON.stringify(this.dataList))
       console.log(retList)
-      // if (retList.length == 0) {
-      //   this.$message.info('请添加产品信息')
-      //   return
-      // }
       let hasError = 0
       retList.map(item => {
         if (!item.expense) {
@@ -238,10 +235,6 @@ export default {
         delete item.productType
         delete item.no
       })
-      // if (hasError == 1) {
-      //   this.$message.info('请输入费用金额')
-      //   return
-      // }
       if (hasError == 2) {
         this.$message.info('产品品牌、产品分类、产品编码,三个至少填一个')
         return

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

@@ -36,7 +36,7 @@ export default {
       type: Boolean,
       default: false
     },
-    itemSn: {
+    itemSn: { // 费用单sn
       type: [Number, String],
       default: ''
     }

+ 37 - 27
src/views/expenseManagement/expenseReimbursementDetail/list.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="审核时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="expenseReimbursementDetailList-rangeDate" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -40,6 +40,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="费用发生月份">
                   <a-month-picker
+                    id="expenseReimbursementDetailList-month"
                     placeholder="请选择月份"
                     v-model="queryParam.expenseDate"
                     @change="onChange"
@@ -61,14 +62,14 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="记账名称">
                   <!-- 部门 -->
-                  <department v-show="queryParam.accountType=='INNER_ACCOUNT'" @change="accountNameSnChange" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></department>
+                  <department id="expenseReimbursementDetailList-department" v-show="queryParam.accountType=='INNER_ACCOUNT'" @change="accountNameSnChange" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></department>
                   <!-- 经销商 -->
-                  <custList v-show="queryParam.accountType=='CUSTOMER'" ref="custList" @change="accountNameSnChange" placeholder="请选择记账名称(输入名称搜索)"></custList>
+                  <custList id="expenseReimbursementDetailList-custList" v-show="queryParam.accountType=='CUSTOMER'" ref="custList" @change="accountNameSnChange" placeholder="请选择记账名称(输入名称搜索)"></custList>
                   <!-- 供应商 -->
-                  <supplier v-show="queryParam.accountType=='OUT_ACCOUNT'" @change="accountNameSnChange" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></supplier>
+                  <supplier id="expenseReimbursementDetailList-supplier" v-show="queryParam.accountType=='OUT_ACCOUNT'" @change="accountNameSnChange" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></supplier>
                   <!-- 其它往来 -->
-                  <otherTransactions v-show="queryParam.accountType=='OTHER_ACCOUNT'" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></otherTransactions>
-                  <a-select style="width: 100%" v-if="!queryParam.accountType" placeholder="请选择记账名称">
+                  <otherTransactions id="expenseReimbursementDetailList-other" v-show="queryParam.accountType=='OTHER_ACCOUNT'" v-model="queryParam.accountNameSn" placeholder="请选择记账名称(输入名称搜索)"></otherTransactions>
+                  <a-select style="width: 100%" v-if="!queryParam.accountType" placeholder="请选择记账名称" id="expenseReimbursementDetailList-kong">
                     <a-select-option value="" :disabled="true">
                       请先选择记账类型
                     </a-select-option>
@@ -99,6 +100,7 @@
                 <a-form-item label="费用承担方类型" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
                   <v-select
                     code="EXPENSE_ACCOUNT_DETAIL_SPLIT_OBJ_TYPE"
+                    id="expenseReimbursementDetailList-splitObjType"
                     allowClear
                     style="width: 100%;"
                     v-model="queryParam.splitObjType"
@@ -110,10 +112,10 @@
               <a-col :md="6" :sm="24">
                 <a-form-item label="费用承担方" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
                   <!-- 部门 -->
-                  <department v-show="queryParam.splitObjType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择承担方" v-model="queryParam.splitObjSn"></department>
+                  <department id="expenseReimbursementDetailList-department" v-show="queryParam.splitObjType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择承担方" v-model="queryParam.splitObjSn"></department>
                   <!-- 经销商 -->
-                  <custList v-show="queryParam.splitObjType=='CUSTOMER'" ref="custList" @change="custChange" placeholder="请选择(输入名称搜索)"></custList>
-                  <a-select style="width: 100%" v-if="!queryParam.splitObjType" placeholder="请选择">
+                  <custList id="expenseReimbursementDetailList-custList" v-show="queryParam.splitObjType=='CUSTOMER'" ref="custList" @change="custChange" placeholder="请选择(输入名称搜索)"></custList>
+                  <a-select style="width: 100%" v-if="!queryParam.splitObjType" placeholder="请选择" id="expenseReimbursementDetailList-kong1">
                     <a-select-option value="" :disabled="true">
                       请先选择承担方类型
                     </a-select-option>
@@ -122,12 +124,12 @@
               </a-col>
               <a-col :md="6" :sm="24" v-show="queryParam.splitObjType=='DEPARTMENT'">
                 <a-form-item label="费用承担人" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                  <employee style="width: 100%;" placeholder="请选择承担人员" v-model="queryParam.childSplitObjSn"></employee>
+                  <employee id="expenseReimbursementDetailList-employee" style="width: 100%;" placeholder="请选择承担人员" v-model="queryParam.childSplitObjSn"></employee>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="queryParam.splitObjType==undefined">
                 <a-form-item label="费用承担人" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-                  <a-select style="width: 100%" placeholder="请选择">
+                  <a-select style="width: 100%" placeholder="请选择" id="expenseReimbursementDetailList-kong2">
                     <a-select-option value="" :disabled="true">
                       请先选择承担方类型
                     </a-select-option>
@@ -142,8 +144,8 @@
             </template>
             <a-col :md="6" :sm="24">
               <div 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 id="expenseReimbursementDetailList-search" type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button id="expenseReimbursementDetailList-reset" style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
                 <a-button
                   style="margin-left: 10px"
                   type="primary"
@@ -153,7 +155,7 @@
                   :loading="exportLoading"
                   v-if="$hasPermissions('B_expenseAcctDetailReport')"
                   id="expenseAcctDetail-export">导出</a-button>
-                <a @click="advanced=!advanced" style="margin-left: 8px">
+                <a @click="advanced=!advanced" style="margin-left: 8px" id="expenseReimbursementDetailList-advanced">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
                 </a>
@@ -220,14 +222,14 @@ export default {
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 选择客户弹框是否显示
-      exportLoading: false,
+      exportLoading: false, // 导出loading
       tableHeight: 0,
       time: [
         moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
-      countData: null,
-      expenseTypes: [],
+      countData: null, // 统计信息
+      expenseTypes: [], // 费用类型
       // 查询参数
       queryParam: {
         expenseDate: undefined, // 月份
@@ -244,15 +246,15 @@ export default {
         splitObjType: undefined, // 费用承担方类型
         splitObjSn: undefined, //  费用承担方
         childSplitObjSn: undefined, // 费用承担人
-        subareaArea: {
+        subareaArea: { // 区域信息
           subareaName: '',
           subareaAreaName: ''
         },
-        provinceName: '',
-        cityName: '',
+        provinceName: '', // 省
         provinceSn: undefined,
+        cityName: '', // 市
         citySn: undefined,
-        bizUserSn: undefined
+        bizUserSn: undefined // 客服
       },
       addrProvinceList: [], // 省列表
       addrCityList: [], // 城市列表数据
@@ -315,46 +317,52 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 费用发生月份
     onChange (date, dateString) {
       this.queryParam.expenseDate = dateString
     },
+    // 费用发生月份禁用时间
+    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] : ''
       this.queryParam.expenseType3 = val && val[2] ? val[2] : ''
     },
+    // 经销商 ,费用承担方
     custChange (val) {
       this.queryParam.splitObjSn = val.key
     },
-    disabledDate (current) {
-      return current && current > moment().endOf('day')
-    },
+    // 申请人选择
     employeeChange (v) {
       this.queryParam.employeeSn = v.key
     },
+    // 申请部门选择
     applyDepartmentChange (v) {
       this.queryParam.applyDepartmentSn = v.key
     },
     // 记账名称变化时
     accountNameSnChange (v, row) {
-      console.log(v, row)
       if (v) {
         this.queryParam.accountNameSn = v.key
       }
     },
+    // 费用承担方类型
     splitObjTypeChange (v) {
       this.queryParam.splitObjSn = undefined
       this.queryParam.childSplitObjSn = undefined
       this.$refs.custList.dealerName = []
     },
+    // 统计信息
     getDetailCount (params) {
       expenseAccountDetailCount(params).then(res => {
         this.countData = res.data || null
       })
     },
-    //  导出
+    //  导出费用报销明细统计报表
     handleExport () {
       const _this = this
       const params = JSON.parse(JSON.stringify(_this.queryParam))
@@ -401,12 +409,14 @@ export default {
       this.expenseTypes = []
       this.$refs.table.refresh(true)
     },
+    // 初始化页面
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 235

+ 2 - 3
src/views/financialManagement/financialCollection/selectGlSalesModal.vue

@@ -127,7 +127,7 @@ export default {
         return []
       }
     },
-    payerType:{
+    payerType: {
       type: String,
       default: ''
     },
@@ -159,7 +159,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return dispatchlList(Object.assign(parameter, this.queryParam, {authFlag:this.payerType=='DEALER'?1:0})).then(res => {
+        return dispatchlList(Object.assign(parameter, this.queryParam, { authFlag: this.payerType == 'DEALER' ? 1 : 0 })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -212,7 +212,6 @@ export default {
       this.detailType = type
       this.bizSn = type == 0 ? row.salesBillSn : row.dispatchBillSn
       this.showDetailModal = true
-      console.log(this.bizSn)
     },
     cancelDetail () {
       this.showDetailModal = false

+ 143 - 113
src/views/financialManagement/warehousingConfirmation/list.vue

@@ -1,106 +1,127 @@
 <template>
   <div>
-  <a-card size="small" :bordered="false" class="searchBoxNormal">
-    <!-- 搜索条件 -->
-    <div ref="tableSearch" class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="入库单号">
-              <a-input id="warehousingConfirmationList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入入库单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="单据状态">
-              <v-select
-                v-model="queryParam.auditState"
-                ref="auditState"
-                id="warehousingConfirmationList-auditState"
-                code="PUT_CONFIRM_STATE"
-                placeholder="请选择单据状态"
-                allowClear></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24" v-show="isShowWarehouse">
-            <a-form-model-item label="仓库">
-              <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehousingConfirmationList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="warehousingConfirmationList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-  </a-card>
-  <a-card size="small" :bordered="false" class="warehousingConfirmationList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <!-- 列表 -->
-      <div v-if="$hasPermissions('B_warehousingConfirmationpl')" style="margin-bottom: 10px">
-        <a-button type="primary" id="warehousingConfirmationList-export" :loading="loading" @click="handleBatchAudit">批量确认</a-button>
-        <span style="margin-left: 10px">
-          <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0"> {{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }} </template>
-        </span>
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="入库单号">
+                <a-input id="warehousingConfirmationList-stockPutNo" v-model.trim="queryParam.stockPutNo" allowClear placeholder="请输入入库单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="单据状态">
+                <v-select
+                  v-model="queryParam.auditState"
+                  ref="auditState"
+                  id="warehousingConfirmationList-auditState"
+                  code="PUT_CONFIRM_STATE"
+                  placeholder="请选择单据状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="业务单号">
+                <a-input id="warehousingConfirmationList-putBizNo" v-model.trim="queryParam.putBizNo" allowClear placeholder="请输入业务单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="入库类型">
+                <v-select
+                  v-model="queryParam.putBizType"
+                  id="warehousingConfirmationList-putBizType"
+                  code="PUT_STOCK_TYPE"
+                  placeholder="请选择入库类型"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-show="isShowWarehouse">
+              <a-form-model-item label="仓库">
+                <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="isShowWarehouse?6:24" :sm="24" style="margin-bottom: 10px;" :style="{textAlign:isShowWarehouse?'left':'center'}">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehousingConfirmationList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="warehousingConfirmationList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
       </div>
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+70+'px' }"
-        size="small"
-        :rowKey="(record) => record.stockPutSn"
-        rowKeyName="stockPutSn"
-        :row-selection="$hasPermissions('B_warehousingConfirmationpl') ? { columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.auditState != 'WAIT' } }) } : null"
-        @rowSelection="rowSelectionFun"
-        :columns="columns"
-        :data="loadData"
-        :pageSize="30"
-        :scroll="{ y: tableHeight }"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 入库单号 -->
-        <template slot="stockPutNo" slot-scope="text, record">
-          <span v-if="$hasPermissions('B_warehousingConfirmationDetail')" class="link-bule" @click="handleDetail(record)">{{ record.stockPutNo }}</span>
-          <span v-else>{{ record.stockPutNo }}</span>
-        </template>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
+    </a-card>
+    <a-card size="small" :bordered="false" class="warehousingConfirmationList-wrap">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 列表 -->
+        <div v-if="$hasPermissions('B_warehousingConfirmationpl')" style="margin-bottom: 10px">
+          <a-button type="primary" id="warehousingConfirmationList-export" :loading="loading" @click="handleBatchAudit">批量确认</a-button>
+          <span style="margin-left: 10px">
+            <template v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0"> {{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }} </template>
+          </span>
+        </div>
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.stockPutSn"
+          rowKeyName="stockPutSn"
+          :row-selection="$hasPermissions('B_warehousingConfirmationpl') ? { columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.auditState != 'WAIT' } }) } : null"
+          @rowSelection="rowSelectionFun"
+          :columns="columns"
+          :data="loadData"
+          :pageSize="30"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 入库单号 -->
+          <template slot="stockPutNo" slot-scope="text, record">
+            <span :id="'warehousingConfirmationList-detail-'+record.stockPutNo" v-if="$hasPermissions('B_warehousingConfirmationDetail')" class="link-bule" @click="handleDetail(record)">{{ record.stockPutNo }}</span>
+            <span v-else>{{ record.stockPutNo }}</span>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.auditState=='WAIT' && $hasPermissions('B_warehousingConfirmationAlone')"
+              class="button-info"
+              @click="handleAudit(record)"
+              :id="'warehousingConfirmationList-audit-btn-'+record.stockPutNo">入库确认</a-button>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 查看 -->
+      <confirmation-detail-modal v-drag :openModal="openModal" :itemSn="itemSn" :nowData="nowData" @close="closeModal" />
+      <!-- 入库确认 -->
+      <a-modal
+        centered
+        v-drag
+        class="confirmation-modal"
+        :footer="null"
+        :maskClosable="false"
+        v-model="confirmationModal"
+        @cancel="confirmationModal=false"
+        :width="416">
+        <div class="confirmation-main">
+          <a-icon type="question-circle" style="color: #faad14;font-size: 22px;margin-right: 16px;" />
+          <div class="confirmation-cont">
+            <p class="confirmation-tit">提示</p>
+            <p class="confirmation-txt">请点击下方按钮确认操作?</p>
+          </div>
+        </div>
+        <div class="btn-box">
           <a-button
-            size="small"
-            type="link"
-            v-if="record.auditState=='WAIT' && $hasPermissions('B_warehousingConfirmationAlone')"
-            class="button-info"
-            @click="handleAudit(record)"
-            id="warehousingConfirmationList-audit-btn">入库确认</a-button>
-          <span v-else>--</span>
-        </template>
-      </s-table>
-    </a-spin>
-    <!-- 查看 -->
-    <confirmation-detail-modal v-drag :openModal="openModal" :itemSn="itemSn" :nowData="nowData" @close="closeModal" />
-    <!-- 入库确认 -->
-    <a-modal
-      centered
-      v-drag
-      class="confirmation-modal"
-      :footer="null"
-      :maskClosable="false"
-      v-model="confirmationModal"
-      @cancel="confirmationModal=false"
-      :width="416">
-      <div class="confirmation-main">
-        <a-icon type="question-circle" style="color: #faad14;font-size: 22px;margin-right: 16px;" />
-        <div class="confirmation-cont">
-          <p class="confirmation-tit">提示</p>
-          <p class="confirmation-txt">请点击下方按钮确认操作?</p>
+            v-if="confirmationInfo&&confirmationInfo.putBizType!='PURCHASE'"
+            id="confir-ruku-cancel"
+            type="primary"
+            :loading="spinning"
+            class="button-error"
+            @click="handleConfirmationFail">不通过</a-button>
+          <a-button id="confir-ruku-ok" type="primary" :loading="spinning" class="button-info" @click="handleConfirmationOk">通过</a-button>
         </div>
-      </div>
-      <div class="btn-box">
-        <a-button type="primary" :loading="spinning" class="button-error" @click="handleConfirmationFail">不通过</a-button>
-        <a-button type="primary" :loading="spinning" class="button-info" @click="handleConfirmationOk">通过</a-button>
-      </div>
-    </a-modal>
-  </a-card>
+      </a-modal>
+    </a-card>
   </div>
 </template>
 
@@ -117,14 +138,16 @@ export default {
   data () {
     return {
       spinning: false,
+      loading: false,
       queryParam: { //  查询条件
         stockPutNo: '', //  入库单号
+        putBizNo: '', //  业务单号
+        putBizType: undefined, //  入库类型
         auditState: undefined, //  状态
         warehouseSn: undefined // 仓库
       },
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
-      loading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -139,13 +162,13 @@ export default {
           return data
         })
       },
-      openModal: false,
-      itemSn: '',
-      nowData: null,
-      confirmationModal: false,
-      confirmationInfo: null,
-      isBatch: false,
-      rowSelectionInfo: null
+      openModal: false, // 详情弹框
+      itemSn: '', // 详情弹框单据sn
+      nowData: null, // 详情弹框当前操作数据
+      confirmationModal: false, // 入库确认弹框
+      confirmationInfo: null, // 确认入库得单据数据
+      isBatch: false, // 是否批量确认入库
+      rowSelectionInfo: null // 批量操作已选数据
     }
   },
   computed: {
@@ -154,20 +177,21 @@ export default {
       const arr = [
         { title: '入库时间', dataIndex: 'putTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '入库单号', scopedSlots: { customRender: 'stockPutNo' }, width: '12%', align: 'center' },
+        { title: '业务单号', dataIndex: 'putBizNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '商户名称', dataIndex: 'providerName', align: 'left', width: '18%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '入库数量', dataIndex: 'productTotalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '入库成本', dataIndex: 'productTotalCost', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据状态', dataIndex: 'auditStateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务审核时间', dataIndex: 'auditTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'remark', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
+      // 是否显示仓库
       if (this.isShowWarehouse) {
         arr.splice(3, 0, { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
       }
       if (this.$hasPermissions('M_warehousingConfirmationList_costPrice')) { // 成本价权限
-        arr.splice(this.isShowWarehouse?5:4, 0, { title: '入库成本', dataIndex: 'productTotalCost', width: '7%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(this.isShowWarehouse ? 5 : 4, 0, { title: '入库成本', dataIndex: 'productTotalCost', width: '7%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
 
       return arr
@@ -181,6 +205,8 @@ export default {
     //  重置
     resetSearchForm () {
       this.queryParam.stockPutNo = ''
+      this.queryParam.putBizNo = ''
+      this.queryParam.putBizType = undefined
       this.queryParam.auditState = undefined
       this.queryParam.warehouseSn = undefined
       this.$refs.table.refresh(true)
@@ -193,12 +219,13 @@ export default {
         this.openModal = true
       }
     },
+    // 关闭详情弹框
     closeModal () {
       this.itemSn = ''
       this.nowData = null
       this.openModal = false
     },
-    // 通过
+    // 入库确认通过
     handleConfirmationOk () {
       if (this.isBatch) { //  批量
         this.auditOrder(this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys, true)
@@ -206,7 +233,7 @@ export default {
         this.auditOrder([this.confirmationInfo.stockPutSn], true)
       }
     },
-    // 不通过
+    // 入库确认不通过
     handleConfirmationFail () {
       if (this.isBatch) { //  批量
         this.auditOrder(this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys, false)
@@ -214,12 +241,13 @@ export default {
         this.auditOrder([this.confirmationInfo.stockPutSn], false)
       }
     },
-    // 单个审核
+    // 打开入库确认
     handleAudit (row) {
       this.confirmationInfo = row
       this.isBatch = false
       this.confirmationModal = true
     },
+    // 入库确认接口调用
     auditOrder (snList, flag) {
       const _this = this
       if (this.isBatch) {
@@ -244,7 +272,7 @@ export default {
         }
       })
     },
-    // 批量审核
+    // 批量入库确认
     handleBatchAudit () {
       const _this = this
       if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
@@ -254,6 +282,7 @@ export default {
       this.isBatch = true
       this.confirmationModal = true
     },
+    // 页面初始
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -262,6 +291,7 @@ export default {
       this.rowSelectionInfo = null
       this.$refs.table.clearTable()
     },
+    // 表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240

+ 11 - 11
src/views/inventoryManagement/inventoryCheck/addModal.vue

@@ -17,12 +17,12 @@
           <p>确定创建新的盘点单吗?</p>
           <p v-show="isShowWarehouse">
             仓库:<warehouse
-                    style="width:200px;"
-                    v-model="form.warehouseSn"
-                    isPermission
-                    id="inventoryCheckAddModal-warehouseSn"
-                    placeholder="请选择仓库"
-                  />
+              style="width:200px;"
+              v-model="form.warehouseSn"
+              isPermission
+              id="inventoryCheckAddModal-warehouseSn"
+              placeholder="请选择仓库"
+            />
           </p>
         </div>
         <div class="btn-cont">
@@ -41,7 +41,7 @@ import warehouse from '@/views/common/chooseWarehouse.js'
 export default {
   name: 'ProductInfoDetailModal',
   mixins: [commonMixin],
-  components:{warehouse},
+  components: { warehouse },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -51,14 +51,14 @@ export default {
   data () {
     return {
       spinning: false,
-      form:{warehouseSn:undefined},
+      form: { warehouseSn: undefined }, // 仓库sn
       isShow: this.openModal //  是否打开弹框
     }
   },
   methods: {
     // 确定
     handleSave () {
-      if(this.isShowWarehouse && !this.form.warehouseSn){
+      if (this.isShowWarehouse && !this.form.warehouseSn) {
         this.$message.error('请选择仓库')
         return
       }
@@ -83,10 +83,10 @@ export default {
       if (!newValue) {
         this.form.warehouseSn = undefined
         this.$emit('close')
-      }else{
+      } else {
         // 默认仓库
         const defWareHouse = this.$store.state.app.defWarehouse
-        this.form.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse?defWareHouse.warehouseSn:undefined)
+        this.form.warehouseSn = this.isShowWarehouse ? undefined : (defWareHouse ? defWareHouse.warehouseSn : undefined)
       }
     }
   }

+ 15 - 13
src/views/inventoryManagement/inventoryCheck/detail.vue

@@ -7,7 +7,7 @@
           <a id="inventoryCheckDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <span class="billno">单号:{{ detail&&detail.checkWarehouseNo }}</span>
           <span class="state-c" v-if="detail&&detail.state=='DELETE'">已作废</span>
-          <a-button size="small" type="link" class="button-default" @click="showDetail=!showDetail">
+          <a-button size="small" type="link" class="button-default" id="inventoryCheckDetail-desc-btn" @click="showDetail=!showDetail">
             <a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
           </a-button>
         </template>
@@ -47,7 +47,7 @@
                 <a-row :gutter="15">
                   <a-col :md="8" :sm="24">
                     <a-form-model-item label="产品编码">
-                      <a-input v-model.trim="queryParam.productCode" allowClear placeholder="输入产品编码" />
+                      <a-input id="inventoryCheckDetail-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="输入产品编码" />
                     </a-form-model-item>
                   </a-col>
                   <a-col :md="8" :sm="24">
@@ -59,7 +59,7 @@
             </a-col>
             <a-col :span="6">
               <div style="float:right;overflow: hidden;margin-top:6px;">
-                <a-checkbox v-model="foldState" @change="foldStateChange"><span style="display: inline-block;margin-top: 1px;">折叠列表</span></a-checkbox>
+                <a-checkbox id="inventoryCheckDetail-foldState" v-model="foldState" @change="foldStateChange"><span style="display: inline-block;margin-top: 1px;">折叠列表</span></a-checkbox>
               </div>
             </a-col>
           </a-row>
@@ -118,7 +118,7 @@ export default {
       loading: false,
       showDetail: false,
       queryParam: {
-        productCode: ''
+        productCode: '' // 产品编码
       },
       // 表头
       columns: [
@@ -134,13 +134,13 @@ export default {
         { title: '盘点数量', dataIndex: 'checkQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '监盘数量', dataIndex: 'checkSuperviseQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
-      list: [],
+      list: [], // 列表数据
       paginationProps: {
         total: 0, //  分页总条数
         current: 1,
         pageSize: 20
       },
-      expandedRowKeys: [],
+      expandedRowKeys: [], // 展开行
       detail: null, //  详情数据
       foldState: false, //  是否折叠列表
       productTotal: null //  合计
@@ -149,7 +149,7 @@ export default {
   methods: {
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/inventoryManagement/inventoryCheck/list/0', query: { closeLastOldTab: true } })
+      this.$router.push({ name: 'inventoryCheckList', params: { type: 0 } })
     },
     // 重置
     resetSearchForm () {
@@ -169,11 +169,9 @@ export default {
           checkWarehouseDelete({ checkWarehouseSn: _this.$route.params.sn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.spinning = false
-              _this.$router.push({ path: '/inventoryManagement/inventoryCheck/list/1', query: { closeLastOldTab: true } })
-            } else {
-              _this.spinning = false
+              _this.$router.push({ name: 'inventoryCheckList', params: { type: 1 } })
             }
+            _this.spinning = false
           })
         }
       })
@@ -186,8 +184,7 @@ export default {
         pageNo: this.paginationProps.current,
         pageSize: this.paginationProps.pageSize,
         checkWarehouseSn: this.$route.params.sn,
-        productCode: this.queryParam.productCode,
-        // checkWarehouseSn: this.detail.warehouseSn
+        productCode: this.queryParam.productCode
       }
       this.loading = true
       checkWarehouseDetailList(params).then(res => {
@@ -195,9 +192,11 @@ export default {
         if (res.status == 200) {
           this.getCount(params)
           const data = res.data
+          // 分页总记录数
           this.paginationProps.total = Number(res.data.count) || 0
           this.paginationProps.current = data.pageNo
           const no = (data.pageNo - 1) * data.pageSize
+          // 可展开行
           this.expandedRowKeys = []
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
@@ -215,6 +214,7 @@ export default {
         }
       })
     },
+    // 统计数据
     getCount (params) {
       checkWarehouseDetailCount(params).then(res => {
         if (res.status == 200) {
@@ -261,9 +261,11 @@ export default {
     },
     // 折叠列表
     foldStateChange (e) {
+      // 收起
       if (e.target.checked) {
         this.expandedRowKeys = []
       } else {
+        // 展开
         this.expandedRowKeys = []
         this.list.map(item => {
           this.expandedRowKeys.push(item.id + item.type)

+ 130 - 133
src/views/inventoryManagement/inventoryCheck/list.vue

@@ -1,109 +1,109 @@
 <template>
   <div>
-  <a-card size="small" :bordered="false" class="searchBoxNormal">
-    <!-- 搜索条件 -->
-    <div ref="tableSearch" class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="盘点单号">
-              <a-input id="inventoryCheckList-checkWarehouseNo" v-model.trim="queryParam.checkWarehouseNo" allowClear placeholder="请输入盘点单号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="4" :sm="24" v-show="isShowWarehouse">
-            <a-form-item label="仓库">
-              <warehouse
-                v-model="queryParam.warehouseSn"
-                isPermission
-                id="inventoryCheckList-warehouseSn"
-                placeholder="请选择仓库"
-              />
-            </a-form-item>
-          </a-col>
-          <a-col :md="4" :sm="24">
-            <a-form-item label="盘点状态">
-              <v-select
-                v-model="queryParam.checkState"
-                ref="checkState"
-                id="inventoryCheckList-checkState"
-                code="CHECK_WAREHOUSE_STATE"
-                placeholder="请选择盘点状态"
-                allowClear
-              ></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="4" :sm="24">
-            <a-form-item label="监盘状态">
-              <v-select
-                v-model="queryParam.checkSuperviseState"
-                ref="checkSuperviseState"
-                id="inventoryCheckList-checkSuperviseState"
-                code="CHECK_WAREHOUSE_SUPERVISE_STATE"
-                placeholder="请选择监盘状态"
-                allowClear
-              ></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckList-reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-  </a-card>
-  <a-card size="small" :bordered="false" class="inventoryCheckList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <!-- 操作按钮 -->
-      <div class="table-operator flex-center" style="justify-content: space-between;">
-        <div class="flex-center">
-          <a-button v-if="$hasPermissions('B_inventoryCheckAdd')" id="inventoryCheckList-add" type="primary" @click="handleAdd">新增</a-button>
-        </div>
-        <div>
-          <a-radio-group v-model="queryParam.deleteFlag" @change="handleTabChange">
-            <a-radio-button v-for="item in tabPaneData" :key="item.type" :value="item.type">
-              {{ item.name }}
-            </a-radio-button>
-          </a-radio-group>
-        </div>
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="盘点单号">
+                <a-input id="inventoryCheckList-checkWarehouseNo" v-model.trim="queryParam.checkWarehouseNo" allowClear placeholder="请输入盘点单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24" v-show="isShowWarehouse">
+              <a-form-item label="仓库">
+                <warehouse
+                  v-model="queryParam.warehouseSn"
+                  isPermission
+                  id="inventoryCheckList-warehouseSn"
+                  placeholder="请选择仓库"
+                />
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="盘点状态">
+                <v-select
+                  v-model="queryParam.checkState"
+                  ref="checkState"
+                  id="inventoryCheckList-checkState"
+                  code="CHECK_WAREHOUSE_STATE"
+                  placeholder="请选择盘点状态"
+                  allowClear
+                ></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="监盘状态">
+                <v-select
+                  v-model="queryParam.checkSuperviseState"
+                  ref="checkSuperviseState"
+                  id="inventoryCheckList-checkSuperviseState"
+                  code="CHECK_WAREHOUSE_SUPERVISE_STATE"
+                  placeholder="请选择监盘状态"
+                  allowClear
+                ></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckList-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
       </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+70+'px' }"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ y: tableHeight }"
-        :pageSize="30"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button
-            size="small"
-            type="link"
-            v-if="$hasPermissions('B_inventoryCheckDetail')"
-            class="button-success"
-            @click="handleDetail(record)"
-            id="inventoryCheckList-audit-btn">详情</a-button>
-          <span v-else>--</span>
-        </template>
-      </s-table>
-    </a-spin>
-    <!-- 新增盘点单 -->
-    <inventory-check-add-modal :openModal="openAddModal" @ok="handleAddOk" @close="openAddModal=false" />
-    <!-- 盘点校验 -->
-    <common-modal
-      :openModal="openCommonModal"
-      :modalHtml="modalHtml"
-      okText="好的"
-      :isCancel="false"
-      @ok="openCommonModal=false"
-      @cancel="openCommonModal=false" />
-  </a-card>
+    </a-card>
+    <a-card size="small" :bordered="false" class="inventoryCheckList-wrap">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 操作按钮 -->
+        <div class="table-operator flex-center" style="justify-content: space-between;">
+          <div class="flex-center">
+            <a-button v-if="$hasPermissions('B_inventoryCheckAdd')" id="inventoryCheckList-add" type="primary" @click="handleAdd">新增</a-button>
+          </div>
+          <div>
+            <a-radio-group v-model="queryParam.deleteFlag" @change="handleTabChange" id="inventoryCheckList-radio-tab">
+              <a-radio-button v-for="item in tabPaneData" :key="item.type" :id="item.type" :value="item.type">
+                {{ item.name }}
+              </a-radio-button>
+            </a-radio-group>
+          </div>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :pageSize="30"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              v-if="$hasPermissions('B_inventoryCheckDetail')"
+              class="button-success"
+              @click="handleDetail(record)"
+              :id="'inventoryCheckList-audit-'+record.id">详情</a-button>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 新增盘点单 -->
+      <inventory-check-add-modal :openModal="openAddModal" @ok="handleAddOk" @close="openAddModal=false" />
+      <!-- 盘点校验 -->
+      <common-modal
+        :openModal="openCommonModal"
+        :modalHtml="modalHtml"
+        okText="好的"
+        :isCancel="false"
+        @ok="openCommonModal=false"
+        @cancel="openCommonModal=false" />
+    </a-card>
   </div>
 </template>
 
@@ -123,11 +123,11 @@ export default {
       spinning: false,
       tableHeight: 0,
       queryParam: { //  查询条件
-        deleteFlag: this.$route.params.type,
-        checkWarehouseNo: '',
-        checkState: undefined,
-        warehouseSn: undefined,
-        checkSuperviseState: undefined
+        deleteFlag: this.$route.params.type, // 类型
+        checkWarehouseNo: '', // 盘点单号
+        checkState: undefined, // 盘点状态
+        warehouseSn: undefined, // 仓库
+        checkSuperviseState: undefined // 监盘状态
       },
       disabled: false, //  查询、重置按钮是否可操作
       tabPaneData: [
@@ -153,25 +153,25 @@ export default {
         })
       },
       openModal: false,
-      itemSn: '',
-      openAddModal: false,
-      openCommonModal: false,
-      modalHtml: ''
+      itemSn: '', // 当前编辑sn
+      openAddModal: false, // 新增盘点单弹框
+      openCommonModal: false, // 盘点校验提示弹框
+      modalHtml: '' // 盘点校验弹框内容
     }
   },
   computed: {
     columns () {
       let arr = [
-          { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-          { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '10%', align: 'center' },
-          // { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '盘点状态', dataIndex: 'checkStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '监盘状态', dataIndex: 'checkSuperviseStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '盘点人', dataIndex: 'checkPersonName', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true },
-          { title: '盘点提交时间', dataIndex: 'checkTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-          { title: '监盘人', dataIndex: 'checkSupervisePersonName', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true },
-          { title: '监盘提交时间', dataIndex: 'checkSuperviseTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        ]
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '盘点单号', dataIndex: 'checkWarehouseNo', width: '10%', align: 'center' },
+        // { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '盘点状态', dataIndex: 'checkStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '监盘状态', dataIndex: 'checkSuperviseStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '盘点人', dataIndex: 'checkPersonName', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '盘点提交时间', dataIndex: 'checkTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '监盘人', dataIndex: 'checkSupervisePersonName', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '监盘提交时间', dataIndex: 'checkSuperviseTime', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
 
       if (this.queryParam.deleteFlag == '0') { // 正常
         arr = arr.concat([
@@ -187,8 +187,8 @@ export default {
         ])
       }
 
-      if(this.isShowWarehouse){
-        arr.splice(2,0,{ title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } })
+      if (this.isShowWarehouse) {
+        arr.splice(2, 0, { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       return arr
     }
@@ -200,7 +200,8 @@ export default {
     },
     // 新增 成功
     handleAddOk (data) {
-      this.$router.push({ path: `/inventoryManagement/inventoryCheck/detail/${data.checkWarehouseSn}` })
+      this.openAddModal = false
+      this.handleDetail(data)
     },
     // 选择类型
     handleTabChange (event) {
@@ -209,10 +210,9 @@ export default {
     },
     // 详情
     handleDetail (row) {
-      if (this.$hasPermissions('B_inventoryCheckDetail')) {
-        this.$router.push({ path: `/inventoryManagement/inventoryCheck/detail/${row.checkWarehouseSn}` })
-      }
+      this.$router.push({ name: 'inventoryCheckDetail', params: { sn: row.checkWarehouseSn } })
     },
+    // 重置列表
     resetSearchForm () {
       this.queryParam.checkWarehouseNo = ''
       this.queryParam.checkState = undefined
@@ -220,16 +220,13 @@ export default {
       this.queryParam.warehouseSn = undefined
       this.$refs.table.refresh(true)
     },
-    closeModal () {
-      this.itemSn = ''
-      this.openModal = false
-    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 表格高度计算
     setTableH () {
       this.tableHeight = window.innerHeight - 283
     }
@@ -272,6 +269,6 @@ export default {
 
 <style lang="less">
   .inventoryCheckList-wrap{
-    
+
   }
 </style>

+ 15 - 4
src/views/inventoryManagement/inventoryQuery/detailModal.vue

@@ -26,6 +26,16 @@
       :data="loadData"
       :scroll="{ y: 500 }"
       bordered>
+      <template slot="currentQty" slot-scope="text, record">
+        <span style="vertical-align: middle;margin-right:5px;"> {{ (record.currentQty ||record.currentQty==0)?record.currentQty:'--' }}</span>
+        <a-tooltip placement="bottom" v-if="record.lockFlag==1" >
+          <template slot="title">
+            采购入库的库存为锁定库存
+          </template>
+          <a-badge count="锁" v-if="record.lockFlag==1" :number-style="{ zoom:'80%' }"></a-badge>
+        </a-tooltip>
+
+      </template>
     </s-table>
     <div class="btn-cont">
       <a-button id="inventoryQueryDetail-detail-modal-back" @click="isShow = false">返回列表</a-button>
@@ -91,17 +101,17 @@ export default {
       return ((currentStockCost * 1000 + freezeStockCost * 1000) / 1000).toFixed(2)
     },
     columns () {
-      let _this=this
+      const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'left', width: '22%', ellipsis: true, customRender: function (text) { return text || '--' }, ellipsis: true},
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'left', customRender: function (text) { return text ? text : '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'left', width: '22%', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '入库时间', dataIndex: 'putTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '库存数量', dataIndex: 'currentQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '库存数量', scopedSlots: { customRender: 'currentQty' }, dataIndex: 'currentQty', width: '6%', align: 'center' }
       ]
       if (this.$hasPermissions('B_inventoryQuery_detail_costPrice')) { // 成本价权限
         arr.splice(9, 0, { title: '成本单价', dataIndex: 'putCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
@@ -123,6 +133,7 @@ export default {
         }
       })
     },
+    // 重置
     resetPage () {
       this.currentStock = { // 合计信息
         currentQty: '',

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

@@ -18,9 +18,9 @@
         :wrapper-col="formItemLayout.wrapperCol"
       >
         <a-form-model-item label="导出库存" prop="exportType">
-          <a-radio-group v-model="form.exportType">
-            <a-radio value="all">所有</a-radio>
-            <a-radio value="type">分类汇总导出</a-radio>
+          <a-radio-group v-model="form.exportType" id="export-excel-radio">
+            <a-radio value="all" id="export-excel-radio-all">所有</a-radio>
+            <a-radio value="type" id="export-excel-radio-type">分类汇总导出</a-radio>
           </a-radio-group>
         </a-form-model-item>
       </a-form-model>
@@ -50,7 +50,7 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       form: {
-        exportType: 'all'
+        exportType: 'all' // 导出方式
       },
       rules: {
         exportType: [{ required: true, message: '请选择导出方式', trigger: 'change' }]
@@ -72,7 +72,6 @@ export default {
           _this.$emit('ok', _this.form.exportType)
           _this.isShow = false
         } else {
-          console.log('error submit!!')
           return false
         }
       })

+ 126 - 125
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -1,124 +1,120 @@
 <template>
   <div>
-   <a-card size="small" :bordered="false" class="searchBoxNormal">
-     <!-- 搜索条件 -->
-     <div ref="tableSearch" class="table-page-search-wrapper">
-       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-         <a-row :gutter="15">
-           <a-col :md="6" :sm="24">
-             <a-form-item label="产品编码">
-               <a-input id="inventoryQueryList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
-             </a-form-item>
-           </a-col>
-           <a-col :md="6" :sm="24">
-             <a-form-item label="原厂编码">
-               <a-input id="inventoryQueryList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
-             </a-form-item>
-           </a-col>
-           <a-col :md="5" :sm="24">
-             <a-form-item label="产品名称">
-               <a-input id="inventoryQueryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-             </a-form-item>
-           </a-col>
-           <template v-if="advanced">
-             <a-col :md="6" :sm="24">
-               <a-form-item label="产品品牌">
-                 <ProductBrand id="inventoryQueryList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
-               </a-form-item>
-             </a-col>
-             <a-col :md="6" :sm="24">
-               <a-form-model-item label="产品分类">
-                 <ProductType id="inventoryQueryList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
-               </a-form-model-item>
-             </a-col>
-             <a-col :md="6" :sm="24">
-               <a-form-item label="仓库">
-                 <warehouse
-                   isPermission
-                   v-model="queryParam.warehouseSn"
-                   id="inventoryQueryList-warehouseSn"
-                   placeholder="请选择仓库"
-                 />
-               </a-form-item>
-             </a-col>
-             <a-col :md="4" :sm="24">
-               <a-form-item label="库存情况">
-                 <a-checkbox v-model="queryParam.zeroQtyFlag" id="inventoryQueryList-zeroQtyFlag">只查看有库存</a-checkbox>
-               </a-form-item>
-             </a-col>
-           </template>
-           <a-col :md="7" :sm="24">
-             <a-button type="primary" @click="$refs.table.refresh()" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
-             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
-             <a-button
-               v-if="$hasPermissions('B_inventoryQuery_export')"
-               type="primary"
-               style="margin-left: 5px"
-               class="button-warning"
-               @click="openExcelModal=true"
-               :disabled="disabled"
-               :loading="exportLoading"
-               id="inventoryQueryList-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>
-  </a-card>
-  
-  <a-card size="small" :bordered="false" class="inventoryQueryList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <!-- 合计 -->
-      <div class="ftext tongji-bar">
-        可用库存总数量:<strong>{{ (currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0)) ? currentStock.currentStockQty : '--' }}个</strong>;
-        <span v-if="$hasPermissions('M_inventoryQueryList_costPrice')">可用库存总成本:<strong>{{ (currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0)) ? toThousands(currentStock.currentStockCost) : '--' }}</strong>。</span>
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" id="inventoryQueryList-form" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品编码">
+                <a-input id="inventoryQueryList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="原厂编码">
+                <a-input id="inventoryQueryList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="inventoryQueryList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品品牌">
+                  <ProductBrand id="inventoryQueryList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品分类">
+                  <ProductType id="inventoryQueryList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="仓库">
+                  <warehouse isPermission v-model="queryParam.warehouseSn" id="inventoryQueryList-warehouseSn" placeholder="请选择仓库" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
+                <a-form-item label="库存情况">
+                  <a-checkbox v-model="queryParam.zeroQtyFlag" id="inventoryQueryList-zeroQtyFlag">只查看有库存</a-checkbox>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="7" :sm="24">
+              <a-button type="primary" @click="$refs.table.refresh()" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
+              <a-button
+                v-if="$hasPermissions('B_inventoryQuery_export')"
+                type="primary"
+                style="margin-left: 5px"
+                class="button-warning"
+                @click="openExcelModal=true"
+                :disabled="disabled"
+                :loading="exportLoading"
+                id="inventoryQueryList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" id="inventoryQueryList-advanced">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
       </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+68+'px' }"
-        size="small"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :pageSize="30"
-        :data="loadData"
-        :scroll="{ y: tableHeight }"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 操作 -->
-        <template slot="action" slot-scope="text, record">
-          <a-button
-            v-if="$hasPermissions('B_inventoryQuery_detail')"
-            size="small"
-            type="link"
-            class="button-success"
-            @click="goDetail(record)"
-            id="inventoryQueryList-detail-btn">库存详情</a-button>
-          <a-button
-            v-if="$hasPermissions('B_inventoryQuery_rkDetail')"
-            size="small"
-            type="link"
-            class="button-warning"
-            @click="goWarehouseDetail(record)"
-            id="inventoryQueryList-warehouseDetail-btn">出入库明细</a-button>
-          <span v-if="!$hasPermissions('B_inventoryQuery_detail')&&!$hasPermissions('B_inventoryQuery_rkDetail')">--</span>
-        </template>
-      </s-table>
-    </a-spin>
-    <!-- 库存详情 -->
-    <inventory-query-detail-modal v-drag :openModal="openModal" :itemId="itemId" @close="closeModal" />
-    <!-- 导出Excel -->
-    <export-excel-modal :openModal="openExcelModal" @ok="handleExcelOk" @close="openExcelModal=false" />
-  </a-card>
+    </a-card>
+
+    <a-card size="small" :bordered="false" class="inventoryQueryList-wrap">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 合计 -->
+        <div class="ftext tongji-bar">
+          可用库存总数量:<strong>{{ (currentStock&&(currentStock.currentStockQty || currentStock.currentStockQty==0)) ? currentStock.currentStockQty : '--' }}个</strong>;
+          <span v-if="$hasPermissions('M_inventoryQueryList_costPrice')">可用库存总成本:<strong>{{ (currentStock&&(currentStock.currentStockCost || currentStock.currentStockCost==0)) ? toThousands(currentStock.currentStockCost) : '--' }}</strong>。</span>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+68+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :pageSize="30"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              v-if="$hasPermissions('B_inventoryQuery_detail')"
+              size="small"
+              type="link"
+              class="button-success"
+              @click="goDetail(record)"
+              :id="'inventoryQueryList-detail-'+record.id">库存详情</a-button>
+            <a-button
+              v-if="$hasPermissions('B_inventoryQuery_rkDetail')"
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="goWarehouseDetail(record)"
+              :id="'inventoryQueryList-whousedetail-'+record.id">出入库明细</a-button>
+            <span v-if="!$hasPermissions('B_inventoryQuery_detail')&&!$hasPermissions('B_inventoryQuery_rkDetail')">--</span>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 库存详情 -->
+      <inventory-query-detail-modal v-drag :openModal="openModal" :itemId="itemId" @close="closeModal" />
+      <!-- 导出Excel -->
+      <export-excel-modal :openModal="openExcelModal" @ok="handleExcelOk" @close="openExcelModal=false" />
+    </a-card>
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import inventoryQueryDetailModal from './detailModal.vue'
 import exportExcelModal from './exportExcelModal.vue'
@@ -126,6 +122,7 @@ import { hdExportExcel } from '@/libs/exportExcel'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
+// 接口
 import { stockList, stockCount, stockExport } from '@/api/stock'
 export default {
   name: 'InventoryQueryList',
@@ -135,7 +132,7 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
         productCode: '', //  产品编码
         productName: '', //  产品名称
@@ -147,7 +144,7 @@ export default {
         productTypeSn3: '', //  产品分类3
         zeroQtyFlag: false //  库存情况
       },
-      productType: [],
+      productType: [], // 产品分类
       exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
       zeroQtyData: [ //  库存情况
@@ -158,32 +155,33 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        console.log(parameter)
         // 排序
-        if (parameter.sortOrder&&parameter.sortField == 'currentStockQty') {
+        if (parameter.sortOrder && parameter.sortField == 'currentStockQty') {
           parameter.sortField = 'qty'
           parameter.sortAlias = ''
         }
-        if (parameter.sortOrder&&parameter.sortField == 'currentStockCost') {
+        if (parameter.sortOrder && parameter.sortField == 'currentStockCost') {
           parameter.sortField = 'currentStockCost'
           parameter.sortAlias = 'stock'
         }
-        
-        if(!parameter.sortOrder){
+        // 没有排序
+        if (!parameter.sortOrder) {
           parameter.sortField = ''
           parameter.sortAlias = ''
         }
-        
+
         const params = Object.assign(parameter, this.queryParam)
         if (params.zeroQtyFlag) {
           params.zeroQtyFlag = '0'
         } else {
           params.zeroQtyFlag = ''
         }
+        // 获取列表数据  有分页
         return stockList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -198,11 +196,12 @@ export default {
       },
       openModal: false, //  查看库存详情  弹框
       itemId: '', //  当前库存记录id
-      currentStock: null,
-      openExcelModal: false
+      currentStock: null, // 可用库存合计
+      openExcelModal: false // 导出Excel弹框
     }
   },
   computed: {
+    // 表头
     columns () {
       const _this = this
       const arr = [
@@ -261,7 +260,7 @@ export default {
     },
     //  出入库明细
     goWarehouseDetail (row) {
-      this.$router.push({ path: `/inventoryManagement/inventoryQuery/warehouseDetail/${row.productSn}/${row.warehouseSn}` })
+      this.$router.push({ name: 'inventoryQueryWarehouseDetail', params: { sn: row.productSn, warehouseSn: row.warehouseSn } })
     },
     // 导出Excel
     handleExcelOk (exportType) {
@@ -287,12 +286,14 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.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 - 226
@@ -338,4 +339,4 @@ export default {
       margin-top: 10px;
     }
   }
-</style>
+</style>

+ 12 - 12
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -79,7 +79,7 @@
                   :disabled="disabled"
                   :loading="exportLoading"
                   id="inventoryQueryList-export">导出</a-button>
-                <a @click="advanced=!advanced" style="margin-left: 5px">
+                <a @click="advanced=!advanced" style="margin-left: 5px" id="inventoryQueryList-advanced">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
                 </a>
@@ -142,15 +142,15 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        bizType: undefined,
-        flowType: undefined,
-        unitName: '',
-        bizNo: '',
-        bizSubNo: '',
-        warehouseSn: undefined,
-        state: undefined
+        beginDate: '', // 开始时间
+        endDate: '', // 结束时间
+        bizType: undefined, // 单据类型
+        flowType: undefined, // 变动类型
+        unitName: '', // 单位
+        bizNo: '', // 关联单号
+        bizSubNo: '', // 下推单号
+        warehouseSn: undefined, // 仓库sn
+        state: undefined // 单据状态
       },
       disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
@@ -178,7 +178,7 @@ export default {
           return data
         })
       },
-      exportLoading: false,
+      exportLoading: false, // 导出按钮loading
       productTotal: null //  合计
     }
   },
@@ -257,7 +257,7 @@ export default {
     },
     //  返回列表
     handleBack () {
-      this.$router.push({ path: '/inventoryManagement/inventoryQuery/list', query: { closeLastOldTab: true } })
+      this.$router.push({ name: 'inventoryQueryList', query: { closeLastOldTab: true } })
     },
     pageInit () {
       const _this = this

+ 19 - 12
src/views/power/OperateJournal/OperateJournal.vue

@@ -3,21 +3,21 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <!-- 搜索框 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" id="operateJournal-form" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="操作时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="operateJournal-rangeDate" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="操作信息">
-                <a-input allowClear v-model.trim="queryParam.actDesc" placeholder="请输入操作信息" />
+                <a-input id="operateJournal-actDesc" allowClear v-model.trim="queryParam.actDesc" placeholder="请输入操作信息" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="操作人">
-                <a-input allowClear v-model.trim="queryParam.actorName" placeholder="请输入操作人" />
+                <a-input id="operateJournal-actorName" allowClear v-model.trim="queryParam.actorName" placeholder="请输入操作人" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -52,10 +52,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import getDate from '@/libs/getDate'
+// 组件
 import { STable } from '@/components'
-import { journalList } from '@/api/OperateJournal.js'
+import getDate from '@/libs/getDate'
 import rangeDate from '@/views/common/rangeDate.vue'
+// 接口
+import { journalList } from '@/api/OperateJournal.js'
 export default {
   name: 'PowerOperateJournal',
   mixins: [commonMixin],
@@ -64,18 +66,19 @@ export default {
     return {
       advanced: false, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      // 操作时间
       time: [
         getDate.getThreeday().starttime,
         getDate.getThreeday().endtime
       ],
       queryParam: {
-        beginDate: getDate.getThreeday().starttime, // 查询的开始时间
-        endDate: getDate.getThreeday().endtime, // 查询的结束时间
-        actDesc: '',
-        actorName: ''
+        beginDate: getDate.getThreeday().starttime, // 操作开始时间
+        endDate: getDate.getThreeday().endtime, // 操作结束时间
+        actDesc: '', // 操作信息
+        actorName: ''// 操作人
       },
-      dateFormat: 'YYYY-MM-DD',
+      dateFormat: 'YYYY-MM-DD', // 操作时间显示格式
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '操作时间', dataIndex: 'actDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
@@ -86,10 +89,12 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
+        // 获取列表数据 有分页
         return journalList(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
@@ -116,12 +121,14 @@ export default {
       this.queryParam.actorName = ''
       this.$refs.table.refresh(true)
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 210

+ 36 - 26
src/views/power/dataDictionary/codeItemModal.vue

@@ -1,11 +1,11 @@
 <template>
   <div>
     <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancel="cancel">
-      <a-form :form="form" @submit="handleSubmit">
+      <a-form :form="form" id="codeItemModal-form" @submit="handleSubmit">
         <a-row :gutter="24">
           <a-col :span="24">
             <!-- code -->
-            <a-form-item label="字典码" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
+            <a-form-item label="字典码" id="codeItemModal-lookupCode" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
               <a-input
                 disabled
                 placeholder=""
@@ -22,6 +22,7 @@
             <!-- 名称 -->
             <a-form-item label="名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-dispName"
                 placeholder="请输入名称(最多30个字符)"
                 :maxLength="30"
                 v-decorator="['formData.dispName', {
@@ -34,6 +35,7 @@
             <!-- 项编码 -->
             <a-form-item label="项编码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-code"
                 placeholder="请输入项编码"
                 v-decorator="['formData.code', {
                   initialValue: formData.code,
@@ -46,6 +48,7 @@
           <a-col :span="12" style="padding-right: 0px;">
             <a-form-item label="启用" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-radio-group
+                id="codeItemModal-isEnable"
                 name="radioGroup"
                 v-decorator="[
                   'formData.isEnable',
@@ -54,8 +57,8 @@
                     rules: [] },
                 ]"
               >
-                <a-radio :value="1">是</a-radio>
-                <a-radio :value="0">否</a-radio>
+                <a-radio :value="1" id="codeItemModal-isEnable1">是</a-radio>
+                <a-radio :value="0" id="codeItemModal-isEnable0">否</a-radio>
               </a-radio-group>
             </a-form-item>
           </a-col>
@@ -63,6 +66,7 @@
           <a-col :span="12">
             <a-form-item label="排序值" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input-number
+                id="codeItemModal-sort"
                 style="width: 100%;"
                 placeholder="请输入排序值(0~999999)"
                 v-decorator="['formData.sort', {
@@ -80,6 +84,7 @@
             <!-- 扩展一 -->
             <a-form-item label="扩展一" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-attr1"
                 placeholder=""
                 v-decorator="['formData.attr1', {
                   initialValue: formData.attr1,
@@ -92,6 +97,7 @@
             <a-form-item label="扩展二" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder=""
+                id="codeItemModal-attr2"
                 v-decorator="['formData.attr2', {
                   initialValue: formData.attr2,
                   rules: [] }]"
@@ -102,6 +108,7 @@
             <!-- 扩展三 -->
             <a-form-item label="扩展三" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-attr3"
                 placeholder=""
                 v-decorator="['formData.attr3', {
                   initialValue: formData.attr3,
@@ -113,6 +120,7 @@
             <!-- 扩展四 -->
             <a-form-item label="扩展四" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-attr4"
                 placeholder=""
                 v-decorator="['formData.attr4', {
                   initialValue: formData.attr4,
@@ -124,6 +132,7 @@
             <!-- 扩展五 -->
             <a-form-item label="扩展五" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-attr5"
                 placeholder=""
                 v-decorator="['formData.attr5', {
                   initialValue: formData.attr5,
@@ -135,6 +144,7 @@
             <!-- 扩展六 -->
             <a-form-item label="扩展六" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
+                id="codeItemModal-attr6"
                 placeholder=""
                 v-decorator="['formData.attr6', {
                   initialValue: formData.attr6,
@@ -148,6 +158,7 @@
           <a-col :span="24">
             <a-form-item label="备注" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
               <a-textarea
+                id="codeItemModal-remarks"
                 v-decorator="[
                   'formData.remarks',
                   {
@@ -163,10 +174,10 @@
         </a-row>
 
         <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()">
+          <a-button id="codeItemModal-save-btn" type="primary" @click="handleSubmit()">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button id="codeItemModal-cancel-btn" :style="{ marginLeft: '8px' }" @click="handleCancel()">
             取消
           </a-button>
         </a-form-item>
@@ -177,13 +188,13 @@
 </template>
 
 <script>
+// 组件
 import { STable, VSelect } from '@/components'
+// 接口
 import { saveLookUpItem } from '@/api/lookup.js'
 export default {
   name: 'CodeItemModal',
-  components: {
-    STable, VSelect
-  },
+  components: { STable, VSelect },
   props: {
     visible: {
       type: Boolean,
@@ -198,34 +209,35 @@ export default {
   },
   data () {
     return {
-      titleText: '添加字典项',
-      isshow: this.visible,
+      titleText: '添加字典项', // 弹窗标题
+      isshow: this.visible, // 打开关闭弹窗
       formLayout: 'horizontal',
+      // form设置
       form: this.$form.createForm(this, { name: 'miniForm' }),
-      roleList: [],
+      roleList: [], // 列表数据
+      // 提交参数
       formData: {
-        lookupCode: '',
+        lookupCode: '', // 字典码
         code: '', // code
         dispName: '',
         isEnable: 1, // 活动状态
-        sort: '',
-        attr1: '',
-        attr2: '',
-        attr3: '',
-        attr4: '',
-        attr5: '',
-        attr6: '',
-        remarks: ''
+        sort: '', // 排序
+        attr1: '', // 扩展1
+        attr2: '', // 扩展2
+        attr3: '', // 扩展3
+        attr4: '', // 扩展4
+        attr5: '', // 扩展5
+        attr6: '', // 扩展6
+        remarks: ''// 备注
       }
-
     }
   },
   methods: {
+    // 关闭
     cancel (e) {
       this.clear()
       this.$emit('close')
     },
-
     // 保存提交
     handleSubmit () {
       const _this = this
@@ -262,6 +274,7 @@ export default {
         }
       })
     },
+    // 重置
     clear () {
       this.form.resetFields()
       delete this.formData.id
@@ -278,9 +291,6 @@ export default {
       this.formData.attr6 = ''
       this.formData.remarks = ''
     }
-
-  },
-  mounted () {
   },
   beforeCreate () {
     this.form = this.$form.createForm(this, { name: 'miniForm' })

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.