Browse Source

Merge commit 'd0059f7f1ac0db770e096b759e83d8b95e984644' into HEAD

gitadmin 11 months ago
parent
commit
c01e81ee39
72 changed files with 3118 additions and 2677 deletions
  1. 0 2
      src/libs/JGPrint.js
  2. 46 34
      src/views/reportData/actualSalesReport/list.vue
  3. 45 34
      src/views/reportData/allocationDetails/list.vue
  4. 30 21
      src/views/reportData/allocationOrderTotal/list.vue
  5. 38 24
      src/views/reportData/allocationPresentation/list.vue
  6. 30 21
      src/views/reportData/billingBackReport/list.vue
  7. 30 21
      src/views/reportData/billingOrderReport/list.vue
  8. 38 29
      src/views/reportData/billingReturnReport/list.vue
  9. 31 22
      src/views/reportData/expenseAccountReport/bearerList.vue
  10. 34 21
      src/views/reportData/expenseAccountReport/categoryList.vue
  11. 21 26
      src/views/reportData/expenseAccountReport/selectMonth.vue
  12. 15 11
      src/views/reportData/hPriceDifferenceDetailReport/list.vue
  13. 32 22
      src/views/reportData/priceDifferenceDetailReport/list.vue
  14. 43 31
      src/views/reportData/productRebateReport/dealerList.vue
  15. 42 46
      src/views/reportData/productRebateReport/detailList.vue
  16. 5 6
      src/views/reportData/productRebateReport/index.vue
  17. 28 50
      src/views/reportData/productRebateReport/list.vue
  18. 38 28
      src/views/reportData/promotionSalesOrderReport/list.vue
  19. 38 28
      src/views/reportData/promotionSalesRealTimeReport/index.vue
  20. 55 61
      src/views/reportData/promotionSalesRealTimeReport/list.vue
  21. 36 24
      src/views/reportData/receivedSendStorageReport/index.vue
  22. 11 6
      src/views/reportData/receivedSendStorageReport/list.vue
  23. 41 40
      src/views/reportData/regionTypeSalesReport/list.vue
  24. 40 28
      src/views/reportData/returnGoodsPresentation/list.vue
  25. 49 38
      src/views/reportData/returnSlipReport/list.vue
  26. 44 30
      src/views/reportData/salesAmountReport/list.vue
  27. 49 43
      src/views/reportData/salesDetails/list.vue
  28. 56 101
      src/views/reportData/salesOrderTotal/list.vue
  29. 3 2
      src/views/reportData/salesPresentation/list.vue
  30. 116 39
      src/views/reportData/salesReturnDetailReport/list.vue
  31. 39 30
      src/views/reportData/salesReturnReport/list.vue
  32. 44 30
      src/views/reportData/salesReturnsReport/list.vue
  33. 47 34
      src/views/reportData/salesSlipReport/list.vue
  34. 56 38
      src/views/reportData/tireSalesReport/detailList.vue
  35. 4 2
      src/views/reportData/tireSalesReport/index.vue
  36. 39 22
      src/views/reportData/tireSalesReport/list.vue
  37. 60 54
      src/views/reportData/transferReturnDetailReport/list.vue
  38. 47 38
      src/views/reportData/transferReturnReport/list.vue
  39. 42 29
      src/views/reportData/urchaseDetailReturn/detailList.vue
  40. 27 18
      src/views/reportData/urchaseReturn/list.vue
  41. 27 34
      src/views/reportData/warehousingOrder/list.vue
  42. 26 33
      src/views/reportData/warehousingOrderDetail/list.vue
  43. 17 9
      src/views/salesManagement/matchSendOutOrder/list.vue
  44. 28 26
      src/views/salesManagement/pushOrderManagement/detail.vue
  45. 6 5
      src/views/salesManagement/pushOrderManagement/detailForOut.vue
  46. 6 5
      src/views/salesManagement/pushOrderManagement/explainInfoModal.vue
  47. 52 40
      src/views/salesManagement/pushOrderManagement/list.vue
  48. 8 6
      src/views/salesManagement/pushOrderManagement/sendTypeModal.vue
  49. 5 5
      src/views/salesManagement/pushOrderManagement/uniqueCodeModal.vue
  50. 16 14
      src/views/salesManagement/salesCollection/detailModal.vue
  51. 46 36
      src/views/salesManagement/salesCollection/list.vue
  52. 10 7
      src/views/salesManagement/salesCollection/voucherModal.vue
  53. 31 29
      src/views/salesManagement/salesOrderWarehouse/detail.vue
  54. 113 109
      src/views/salesManagement/salesOrderWarehouse/list.vue
  55. 21 17
      src/views/salesManagement/salesOrderWarehouse/printModal.vue
  56. 14 11
      src/views/salesManagement/salesQueryNew/chooseCustomModal.vue
  57. 17 13
      src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue
  58. 8 4
      src/views/salesManagement/salesQueryNew/comps/chooseImportModal.vue
  59. 22 19
      src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue
  60. 405 381
      src/views/salesManagement/salesQueryNew/comps/detailProductList.vue
  61. 9 9
      src/views/salesManagement/salesQueryNew/comps/importGuideModal.vue
  62. 45 32
      src/views/salesManagement/salesQueryNew/comps/productList.vue
  63. 39 27
      src/views/salesManagement/salesQueryNew/comps/productNormalList.vue
  64. 21 18
      src/views/salesManagement/salesQueryNew/detail.vue
  65. 478 477
      src/views/salesManagement/salesQueryNew/detailAll.vue
  66. 34 20
      src/views/salesManagement/salesQueryNew/edit.vue
  67. 81 81
      src/views/salesManagement/salesQueryNew/newPromoModal.vue
  68. 16 9
      src/views/salesManagement/salesQueryNew/printModal.vue
  69. 1 1
      src/views/salesManagement/salesQueryNew/receivingAddress/chooseAddressModal.vue
  70. 5 3
      src/views/salesManagement/salesQueryNew/receivingAddress/editAddressModal.vue
  71. 4 2
      src/views/salesManagement/salesQueryNew/setPriceModal.vue
  72. 18 11
      src/views/salesManagement/salesQueryNew/stockOutDetailModal.vue

+ 0 - 2
src/libs/JGPrint.js

@@ -312,7 +312,6 @@ export const printFun = function (url, params, type, taskName, callback, printLo
       })
       reader.readAsText(res)
     } else {
-      console.log(res, 'printFun')
       // 使用浏览器自带打印功能
       if (type == 'orginPrint' || type == 'orginPreview') {
         winPrintPdf(res, type, callback)
@@ -420,7 +419,6 @@ export const printBase64Fun = function (url, params, type, taskName, callback, p
       })
       reader.readAsText(res)
     } else {
-      console.log(res, 'printFun')
       // 使用浏览器自带打印功能
       if (type == 'orginPrint' || type == 'orginPreview') {
         winPrintPdf(res, type, callback)

+ 46 - 34
src/views/reportData/actualSalesReport/list.vue

@@ -14,7 +14,7 @@
           <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 ref="rangeDate" id="actualSalesReportList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -27,22 +27,21 @@
                 <v-select
                   v-model="queryParam.dealer.dealerLevel"
                   ref="dealerLevel"
-                  id="actualSalesReportList-allocateTypeSn"
+                  id="actualSalesReportList-dealerLevel"
                   code="DEALER_LEVEL"
                   placeholder="请选择客户级别"
                   allowClear></v-select>
               </a-form-model-item>
             </a-col>
-
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="所在区域">
-                  <subarea id="actualSalesReportList-allocateTypeSn" ref="subarea" @change="subareaChange"></subarea>
+                  <subarea id="actualSalesReportList-subarea" ref="subarea" @change="subareaChange"></subarea>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="actualSalesReportList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -51,9 +50,9 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-                <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-                </a-form-item>
+                <a-form-model-item label="客服">
+                  <customerService ref="customerName" id="actualSalesReportList-customerName" v-model="queryParam.bizUserSn"></customerService>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom:10px;">
@@ -124,17 +123,19 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import reportModal from '@/views/common/reportModal.vue'
-import customerService from '@/views/common/customerService.vue'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
 import BizUser from '@/views/common/bizUser.js'
-import { hdExportExcel } from '@/libs/exportExcel'
-import { salesBillRealReportTitle, salesBillRealAmountQueryPageList, salesBillRealReportCount } from '@/api/salesBillReport'
+import customerService from '@/views/common/customerService.vue'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+// 接口
 import { actualSalesExport } from '@/api/reportData'
+import { salesBillRealReportTitle, salesBillRealAmountQueryPageList, salesBillRealReportCount } from '@/api/salesBillReport'
 export default {
   name: 'ActualSalesReportList',
   mixins: [commonMixin],
@@ -143,44 +144,53 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
       showExport: false, // 导出弹窗初始值
-      queryParam: { //  查询条件
+      //  查询条件
+      queryParam: {
+        // 默认下推时间
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
-          bizUserSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
+          bizUserSn: undefined// 区域负责人
         },
         dealer: {
-          dealerSn: undefined,
-          provinceSn: undefined,
-          citySn: undefined,
-          districtSn: undefined,
-          dealerLevel: undefined
+          dealerSn: undefined, // 客户sn
+          provinceSn: undefined, // 省
+          citySn: undefined, // 市
+          districtSn: undefined, // 区
+          dealerLevel: undefined// 客户等价
         },
-        bizUserSn: undefined
+        bizUserSn: undefined// 客服
       },
+      totalData: null, // 统计数据
+      columns: [], // 列表表头
+      countLabel: [], // 统计分类数据
+      countBrandLabel: [], // 统计品牌数据
       rules: {
         'time': [{ required: true, message: '请选择下推时间', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize })
+        // 获取列表数据 有分页
         return salesBillRealAmountQueryPageList(paramsPage).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 获取统计数据
             this.getCount(paramsPage)
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -190,14 +200,11 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      totalData: null,
-      columns: [],
-      countLabel: [],
-      countBrandLabel: []
+      }
     }
   },
   watch: {
+    // 展开收起
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -239,6 +246,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -250,7 +258,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  下推时间  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -260,9 +268,11 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 客户下拉  change
     custChange (val) {
       this.queryParam.dealer.dealerSn = val.key
     },
+    // 所在区域 change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -298,6 +308,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 地区
     areaChange (val) {
       this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
       this.queryParam.dealer.citySn = val[1] ? val[1] : ''
@@ -325,6 +336,7 @@ export default {
       })
       this.resetSearchForm()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 218

+ 45 - 34
src/views/reportData/allocationDetails/list.vue

@@ -16,7 +16,7 @@
           <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 ref="rangeDate" id="allocationDetailsList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -64,7 +64,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="出库仓库">
-                  <chooseWarehouse ref="warehouse" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
+                  <chooseWarehouse ref="warehouse" id="allocationDetailsList-warehouse" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -84,13 +84,13 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
-                  <Area id="allocationDetailsList-shippingAddrProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
+                  <Area id="allocationDetailsList-dealerProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-                <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-                </a-form-item>
+                <a-form-model-item label="客服">
+                  <customerService ref="customerName" id="allocationDetailsList-customerName" v-model="queryParam.bizUserSn"></customerService>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -155,19 +155,21 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import reportModal from '@/views/common/reportModal.vue'
 import subarea from '@/views/common/subarea.js'
 import Area from '@/views/common/area.js'
-import { allocateTypeAllList } from '@/api/allocateType'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
-import { hdExportExcel } from '@/libs/exportExcel'
-import { userQueryList } from '@/api/power-user'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import customerService from '@/views/common/customerService'
 import AllocateType from '@/views/common/allocateType.js'
+// 接口
+import { userQueryList } from '@/api/power-user'
+import { allocateTypeAllList } from '@/api/allocateType'
 import { allocateReportDetailList, allocateReportDetailCount, allocateReportDetailExport } from '@/api/allocateReport'
 export default {
   name: 'AllocationDetailsList',
@@ -176,47 +178,49 @@ export default {
   data () {
     return {
       spinning: false,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
       advanced: false, // 高级搜索 展开/关闭
-      exportLoading: false,
-      tableHeight: 0,
-      showExport: false,
-      allocateTypeVal: [],
-      queryParam: { //  查询条件
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      //  查询条件
+      queryParam: {
+        // 调拨开单日期 默认时间
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        productName: '',
-        productBrandTypeSn: undefined,
-        productBrandSn: undefined, //  产品品牌
-        productCode: '',
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
+        productName: '', // 产品名称
+        productBrandTypeSn: undefined, // 产品分类sn
+        productBrandSn: undefined, //  产品品牌sn
+        productCode: '', // 产品编码
         costTypeSn: undefined, // 费用类型
         allocateSortSn: undefined, //  调拨类型1
         allocateTypeSn: undefined, //  调拨类型2
-        creatorId: undefined,
-        allocateNo: '',
+        creatorId: undefined, // 操作员 id
+        allocateNo: '', // 调拨单号
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        dealerName: '',
-        dealerLevel: undefined,
+        dealerName: '', // 客户名称
+        dealerLevel: undefined, // 客户等级
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined// 分区
         },
-        dealerProvinceSn: undefined,
-        warehouseSn: undefined,
-        bizUserSn: undefined
+        dealerProvinceSn: undefined, // 地区  省份
+        warehouseSn: undefined, // 出库仓库
+        bizUserSn: undefined// 客服
       },
-      productType: [],
-      labelCol: { span: 8 },
-      wrapperCol: { span: 16 },
+      productType: [], // 产品分类
+      allocateTypeVal: [], // 已选费用/调拨类型 值
       rules: {
         'time': [{ required: true, message: '请选择调拨开单日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -224,12 +228,14 @@ export default {
         delete params.time
         this.spinning = true
         if (params.beginDate) {
+          // 获取列表数据  有分页
           return allocateReportDetailList(params).then(res => {
             let data
             if (res.status == 200) {
               data = res.data
               // 总计
               this.getCount(params)
+              // 计算列表序号
               const no = (data.pageNo - 1) * data.pageSize
               for (var i = 0; i < data.list.length; i++) {
                 data.list[i].no = no + i + 1
@@ -309,6 +315,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -324,7 +331,7 @@ export default {
     handleStock () {
       this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
     },
-    //  创建时间  change
+    // 调拨开单日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -334,6 +341,7 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 费用/调拨类型 change
     changeAllocatype (val, opts) {
       this.allocateTypeVal = val || []
       this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
@@ -362,6 +370,7 @@ export default {
         }
       })
     },
+    // 区域分区 change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -450,12 +459,14 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       this.getAllocateTypeAllList()
       this.getUserList()
       this.resetSearchForm()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200

+ 30 - 21
src/views/reportData/allocationOrderTotal/list.vue

@@ -16,7 +16,7 @@
           <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 ref="rangeDate" id="allocationOrderTotalList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -44,9 +44,9 @@
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-              <a-form-item label="客服">
-                <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-              </a-form-item>
+              <a-form-model-item label="客服">
+                <customerService ref="customerName" id="allocationDetailsList-customerName" v-model="queryParam.bizUserSn"></customerService>
+              </a-form-model-item>
             </a-col>
             <a-col :md="isShowCustomerSearch?6:24" :sm="24" style="margin-bottom: 10px;" :style="{textAlign: !isShowCustomerSearch?'center':''}">
               <!-- <a-button
@@ -98,12 +98,14 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { allocateTypeAllList } from '@/api/allocateType'
-import { userQueryList } from '@/api/power-user'
 import AllocateType from '@/views/common/allocateType.js'
 import customerService from '@/views/common/customerService'
+// 接口
+import { allocateTypeAllList } from '@/api/allocateType'
+import { userQueryList } from '@/api/power-user'
 import { allocateReportList, allocateReportCount } from '@/api/allocateReport'
 export default {
   name: 'AllocationOrderTotalList',
@@ -112,23 +114,29 @@ export default {
   data () {
     return {
       spinning: false,
-      allocateTypeVal: [],
-      queryParam: { //  查询条件
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      tableHeight: 0, // 表格高度
+      //  查询条件
+      queryParam: {
+        // 调拨开单日期 默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        allocateNo: '',
-        creatorId: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
+        allocateNo: '', // 调拨单号
+        creatorId: undefined, // 操作员id
         costTypeSn: undefined, // 费用类型
         allocateCategory: undefined, //  调拨类型1
         allocateTypeSn: undefined, //  调拨类型2
         bizUserSn: undefined// 客服
       },
-      labelCol: { span: 8 },
-      wrapperCol: { span: 16 },
+      allocateTypeList: [], //  调拨类型
+      allocateTypeVal: [], // 已选费用/调拨类型
+      operatorList: [], //  操作员下拉数据
+      totalData: null, //  合计
       rules: {
         'time': [{ required: true, message: '请选择调拨开单日期', trigger: 'change' }]
       },
@@ -139,12 +147,14 @@ export default {
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
         this.spinning = true
+        // 获取列表数据 有分页
         return allocateReportList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             // 总计
             this.getCount(params)
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -154,11 +164,7 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      allocateTypeList: [], //  调拨类型
-      operatorList: [], //  操作员下拉数据
-      totalData: null, //  合计
-      tableHeight: 0
+      }
     }
   },
   computed: {
@@ -181,6 +187,7 @@ export default {
     }
   },
   methods: {
+    // 费用/调拨类型 change
     changeAllocatype (val, opts) {
       this.allocateTypeVal = val || []
       this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
@@ -191,7 +198,7 @@ export default {
     handleStock () {
       this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
     },
-    //  创建时间  change
+    //  调拨开单日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -201,7 +208,7 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
-    // 
+    // 
     getCount (params) {
       allocateReportCount(params).then(res => {
         if (res.status == 200) {
@@ -268,6 +275,7 @@ export default {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
+    // 初始化
     pageInit () {
       const _this = this
       _this.getAllocateTypeAllList()
@@ -276,6 +284,7 @@ export default {
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 38 - 24
src/views/reportData/allocationPresentation/list.vue

@@ -15,7 +15,7 @@
             <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 ref="rangeDate" id="allocationPresentationList-time" :value="queryParam.time" @change="dateChange" />
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -71,7 +71,8 @@
             </a-row>
           </a-form-model>
         </div>
-      </a-spin></a-card>
+      </a-spin>
+    </a-card>
     <a-tabs :tabBarStyle="{'background':'#fff'}">
       <a-tab-pane key="1" tab="费用/调拨类型列表">
         <a-card size="small" :bordered="false" class="allocationPresentationList-wrap" :style="{'margin-top':'-16px'}">
@@ -148,13 +149,15 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import reportModal from '@/views/common/reportModal.vue'
 import subarea from '@/views/common/subarea.js'
 import { allocateTypeTreeList } from '@/api/allocateType'
 import AreaList from '@/views/common/areaList.js'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { reportAllocateDbjdReportList, reportAllocateDbjdReportCount, reportAllocateDbjdReportExport } from '@/api/reportData'
 export default {
   name: 'AllocationPresentationList',
@@ -164,40 +167,45 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      showExport: false,
-      queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
-        allocateNo: '',
-        targetName: '',
+      showExport: false, // 导出提示框
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      tableWidth: 0, // 表格宽度
+      //  查询条件
+      queryParam: {
+        time: [], // 调拨日期
+        beginDate: '', // 开始日期
+        endDate: '', // 结束日期
+        allocateNo: '', // 调拨单号
+        targetName: '', // 客户名称
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined// 分区
         },
         dealer: {
-          provinceSn: undefined,
-          citySn: undefined,
-          districtSn: undefined,
-          dealerLevel: undefined
+          provinceSn: undefined, // 省
+          citySn: undefined, // 市
+          districtSn: undefined, // 区
+          dealerLevel: undefined// 客户级别
         }
       },
-      tableHeight: 0,
       rules: {
         'time': [{ required: true, message: '请选择调拨日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize })
+        // 获取列表数据 有分页
         return reportAllocateDbjdReportList(paramsPage).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 获取 费用/调拨类型合计  数据
             this.getCount(paramsPage)
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -208,10 +216,9 @@ export default {
           return data
         })
       },
-      totalData: null,
+      totalData: null, // 费用/调拨类型合计  数据
       allocateType: [], // 调拨类型
-      atypeColList: [],
-      tableWidth: 0
+      atypeColList: []// 重组调拨类型数据
     }
   },
   computed: {
@@ -230,6 +237,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭时,监听表格高度
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -241,6 +249,7 @@ export default {
     }
   },
   methods: {
+    // 组合调拨类型 数据
     getCol (data, key) {
       const ret = []
       for (let i = 0; i < data.length; i++) {
@@ -307,6 +316,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -318,7 +328,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  调拨日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -328,6 +338,7 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 区域分区  change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -358,16 +369,19 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 地区
     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] : ''
     },
+    // 初始化
     pageInit () {
       this.getAllocateType()
       this.resetSearchForm()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 255

+ 30 - 21
src/views/reportData/billingBackReport/list.vue

@@ -13,12 +13,12 @@
           <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 ref="rangeDate" id="billingBackReportList-time" :value="queryParam.time" @change="dateChange"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="供应商名称">
-                <supplier id="billingBackReport-supplierName" v-model="queryParam.supplier.supplierSn" @change="getSupplierName" placeholder="请输入供应商名称"></supplier>
+                <supplier id="billingBackReportList-supplierName" v-model="queryParam.supplier.supplierSn" @change="getSupplierName" placeholder="请输入供应商名称"></supplier>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -88,43 +88,46 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { STable, VSelect } from '@/components'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
+import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import AreaList from '@/views/common/areaList.js'
-import { hdExportExcel } from '@/libs/exportExcel'
 import reportModal from '@/views/common/reportModal.vue'
 import supplier from '@/views/common/supplier.js'
+// 接口
 import { querySupplierPage, querySupplierCount, querySupplierTitle, supplierExport } from '@/api/reportData.js'
 export default {
-  name: 'RegionTypeSalesReportList',
+  name: 'BillingBackReportList',
   mixins: [commonMixin],
   components: { STable, VSelect, rangeDate, reportModal, AreaList, supplier },
   data () {
     return {
       spinning: false,
-      showExport: false,
+      showExport: false, // 导出弹窗提示
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
       queryParam: {
+        // 退货完成日期  默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
         supplier: {
-          supplierSn: undefined,
-          supplierName: undefined,
-          provinceSn: undefined,
-          citySn: undefined,
-          districtSn: undefined
+          supplierSn: undefined, // 供应商 sn
+          supplierName: undefined, // 供应商名称
+          provinceSn: undefined, // 省
+          citySn: undefined, // 市
+          districtSn: undefined// 区
         }
       },
-      countLabel: [],
-      countBrandLabel: [],
-      columns: [],
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      totalData: null,
+      countLabel: [], // 统计 分类数据
+      countBrandLabel: [], // 统计 品牌数据
+      columns: [], // 表头数据
+      totalData: null, // 统计
       rules: {
         'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
       },
@@ -132,13 +135,16 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const params = Object.assign(parameter, this.queryParam) //  无分页
+        const params = Object.assign(parameter, this.queryParam)
         delete params.time
+        // 获取列表数据 有分页
         return querySupplierPage(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(params)
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -168,7 +174,7 @@ export default {
       this.queryParam.supplier.supplierName = item ? item.supplierName : undefined
       this.queryParam.supplier.supplierSn = val
     },
-    //  创建时间  change
+    //  退货完成日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -208,6 +214,7 @@ export default {
       this.$refs.areaList.clearData()
       this.$refs.table.clearTable()
     },
+    // 地区 change
     areaChange (val) {
       this.queryParam.supplier.provinceSn = val[0] ? val[0] : ''
       this.queryParam.supplier.citySn = val[1] ? val[1] : ''
@@ -256,10 +263,12 @@ export default {
       })
       this.resetSearchForm()
     },
+    // 初始化
     pageInit () {
       this.getTableTitle()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 30 - 21
src/views/reportData/billingOrderReport/list.vue

@@ -13,22 +13,22 @@
           <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 ref="rangeDate" id="billingOrderReport-time" :value="queryParam.time" @change="dateChange"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="供应商名称">
-                <supplier id="billingBackReport-supplierName" v-model="queryParam.supplier.supplierSn" @change="getSupplierName" placeholder="请输入供应商名称"></supplier>
+                <supplier id="billingOrderReport-supplierName" v-model="queryParam.supplier.supplierSn" @change="getSupplierName" placeholder="请输入供应商名称"></supplier>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="采购退货单号" >
-                <a-input id="billingBackReport-sparePartsReturnNo" v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入采购退货单号"/>
+                <a-input id="billingOrderReport-sparePartsReturnNo" v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入采购退货单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="地区">
-                <AreaList id="returnSlipReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                <AreaList id="billingOrderReport-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
               </a-form-model-item>
             </a-col>
             <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align:center;">
@@ -93,13 +93,15 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { STable, VSelect } from '@/components'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
+import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import AreaList from '@/views/common/areaList.js'
-import { hdExportExcel } from '@/libs/exportExcel'
 import reportModal from '@/views/common/reportModal.vue'
 import supplier from '@/views/common/supplier.js'
+// 接口
 import { queryBillNoPage, queryBillNoCount, queryBillNoTitle, billNoExport } from '@/api/reportData.js'
 export default {
   name: 'BillingOrderReportList',
@@ -108,30 +110,31 @@ export default {
   data () {
     return {
       spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
       showExport: false, // 导出弹窗
-      tableHeight: 0,
+      tableHeight: 0, // 表格高度
       queryParam: {
+        // 退货完成时间 默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        sparePartsReturnNo: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
+        sparePartsReturnNo: undefined, // 采购退货单号
         supplier: {
-          supplierSn: undefined,
-          supplierName: undefined,
-          provinceSn: undefined,
-          citySn: undefined,
-          districtSn: undefined
+          supplierSn: undefined, // 供应商 sn
+          supplierName: undefined, // 供应商名称
+          provinceSn: undefined, // 省
+          citySn: undefined, // 市
+          districtSn: undefined// 区
         }
       },
-      countLabel: [],
-      countBrandLabel: [],
-      columns: [],
-      totalData: null,
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
+      countLabel: [], // 统计分类数据
+      countBrandLabel: [], // 统计品牌数据
+      columns: [], // 表头数据
+      totalData: null, // 统计
       rules: {
         'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
       },
@@ -141,11 +144,14 @@ export default {
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
+        // 获取列表数据 有分页
         return queryBillNoPage(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(params)
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -215,6 +221,7 @@ export default {
       this.$refs.areaList.clearData()
       this.$refs.table.clearTable()
     },
+    // 地区
     areaChange (val) {
       this.queryParam.supplier.provinceSn = val[0] ? val[0] : ''
       this.queryParam.supplier.citySn = val[1] ? val[1] : ''
@@ -263,10 +270,12 @@ export default {
       })
       this.resetSearchForm()
     },
+    // 初始化
     pageInit () {
       this.getTableTitle()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 38 - 29
src/views/reportData/billingReturnReport/list.vue

@@ -4,7 +4,7 @@
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper newTableSearchName" ref="tableSearch">
         <a-form-model
-          id="returnSlipReportList-form"
+          id="billingReturnReportList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -14,7 +14,7 @@
           <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 ref="rangeDate" id="billingReturnReportList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -42,7 +42,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="billingReturnReportList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -51,9 +51,9 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-                <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-                </a-form-item>
+                <a-form-model-item label="客服">
+                  <customerService id="billingReturnReportList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -123,6 +123,8 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
@@ -131,7 +133,7 @@ import reportModal from '@/views/common/reportModal.vue'
 import AreaList from '@/views/common/areaList.js'
 import BizUser from '@/views/common/bizUser.js'
 import customerService from '@/views/common/customerService'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { salesReportReturnList, salesReportReturnCount, billingReturnExport, salesReturnReportTitle } from '@/api/reportData'
 export default {
   name: 'BillingReturnReportList',
@@ -141,32 +143,34 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      // 查询参数
+      queryParam: {
+        // 退货日期 默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        dealerSn: undefined,
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
+        dealerSn: undefined, // 客户名称
+        provinceSn: undefined, // 省
+        citySn: undefined, // 市
+        districtSn: undefined, // 区
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
-          bizUserSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
+          bizUserSn: undefined// 区域负责人
         },
-        dealerLevel: undefined,
-        bizUserSn: undefined
+        dealerLevel: undefined, // 客户等级
+        bizUserSn: undefined// 客服
       },
       rules: {
         'time': [{ required: true, message: '请选择退货日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false, // 导出loading
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -188,14 +192,14 @@ export default {
           return data
         })
       },
-      productType: [],
-      columns: [],
-      countLabel: [],
-      countBrandLabel: [],
-      totalData: null
+      columns: [], // 表头数据
+      countLabel: [], // 统计 产品分类数据
+      countBrandLabel: [], // 统计 产品品牌数据
+      totalData: null// 统计
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -237,6 +241,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -248,7 +253,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  退货日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -258,9 +263,11 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 客户名称
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
+    // 所在区域
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -292,6 +299,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 地区
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
@@ -322,6 +330,7 @@ export default {
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 31 - 22
src/views/reportData/expenseAccountReport/bearerList.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <div class="table-page-search-wrapper" ref="tableSearch">
         <a-form-model
-          id="returnGoodsPresentationList-form"
+          id="expenseAccountBearerList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -13,7 +13,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="统计月份" prop="months">
-                <a-input :value="queryParam.months?queryParam.months.join(','):''" placeholder="请选择月份(多选)" style="width: 100%;">
+                <a-input id="expenseAccountBearerList-months" :value="queryParam.months?queryParam.months.join(','):''" placeholder="请选择月份(多选)" style="width: 100%;">
                   <span style="cursor: pointer;" slot="addonAfter" @click="openMonth">
                     点击选择
                   </span>
@@ -26,6 +26,7 @@
                   code="EXPENSE_ACCOUNT_DETAIL_SPLIT_OBJ_TYPE"
                   allowClear
                   style="width: 100%;"
+                  id="expenseAccountBearerList-targetType"
                   v-model="queryParam.targetType"
                   @change="targetChange"
                   placeholder="请选择费用承担方类型"
@@ -35,20 +36,21 @@
             <a-col :md="6" :sm="24">
               <a-form-model-item label="费用承担方名称" prop="targetSn">
                 <!-- 部门 -->
-                <department v-show="queryParam.targetType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择费用承担方名称" v-model="queryParam.targetSn"></department>
+                <department id="expenseAccountBearerList-targetSn" v-show="queryParam.targetType=='DEPARTMENT'" style="width: 100%;" placeholder="请选择费用承担方名称" v-model="queryParam.targetSn"></department>
                 <!-- 经销商 -->
                 <custList
                   v-show="queryParam.targetType=='CUSTOMER'"
                   ref="custList"
                   cooperateFlag="1"
                   @change="custChange"
+                  id="expenseAccountBearerList-custList"
                   placeholder="请选择经销商(输入名称搜索)"></custList>
                 <a-select v-if="!queryParam.targetType" placeholder="请选择费用承担方名称"></a-select>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="returnGoodsPresentationList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="returnGoodsPresentationList-reset">重置</a-button>
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="expenseAccountBearerList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="expenseAccountBearerList-reset">重置</a-button>
               <a-button
                 style="margin-left: 5px"
                 type="primary"
@@ -57,7 +59,7 @@
                 :disabled="disabled"
                 v-if="$hasPermissions('B_expenseCollectExportByTarget')"
                 :loading="exportLoading"
-                id="returnGoodsPresentationList-export">导出</a-button>
+                id="expenseAccountBearerList-export">导出</a-button>
             </a-col>
           </a-row>
         </a-form-model>
@@ -99,47 +101,49 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import selectMonth from './selectMonth.vue'
-import { hdExportExcel } from '@/libs/exportExcel'
 import reportModal from '@/views/common/reportModal.vue'
 import department from '@/views/expenseManagement/expenseReimbursement/department.js'
 import custList from '@/views/common/custList.vue'
+// 接口
 import { expenseCollectReportQueryPageByTarget, expenseCollectReportQueryCountByTarget, expenseCollectReportExportByTarget } from '@/api/reportData'
 export default {
-  name: 'AllCountryCostReportList',
+  name: 'ExpenseAccountBearerList',
   mixins: [commonMixin],
   components: { STable, VSelect, selectMonth, department, custList, reportModal },
   data () {
     return {
       spinning: false,
-      open: false,
-      year: '',
       showExport: false, // 导出弹窗初始值
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      tableHeight: 0, // 表格高度
       queryParam: {
-        months: undefined,
-        targetType: undefined,
-        targetSn: undefined
+        months: undefined, // 月
+        targetType: undefined, // 费用承担方类型
+        targetSn: undefined// 费用承担方
       },
-      addrProvinceList: [], //  省下拉
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       rules: {
         'months': [{ required: true, message: '请选择月份', trigger: 'change' }],
         'targetType': [{ required: true, message: '请选择费用承担方类型', trigger: 'change' }],
         'targetSn': [{ required: true, message: '请选择费用承担方名称', trigger: 'change' }]
       },
-      columns: [],
+      columns: [], // 表头数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         const _this = this
         _this.disabled = true
         _this.spinning = true
-        const paramsPage = Object.assign(parameter, this.queryParam) //  有分页
+        const paramsPage = Object.assign(parameter, this.queryParam)
+        // 获取列表数据 无分页
         return expenseCollectReportQueryPageByTarget(paramsPage).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -147,13 +151,13 @@ export default {
           }
           _this.spinning = false
           _this.disabled = false
+          // 统计
           this.getCount(paramsPage)
           return data
         })
       },
-      totalData: null,
-      totalMData: [],
-      tableHeight: 0
+      totalData: null, // 统计数据
+      totalMData: []// 汇总数据
     }
   },
   methods: {
@@ -241,15 +245,17 @@ export default {
     openMonth () {
       this.$refs.months.showModal(this.queryParam.months, 'm1')
     },
+    // 选择月份完成
     getDateValue (data) {
-      console.log(data)
       this.queryParam.months = data
     },
+    // 费用承担方类型 change
     targetChange (v) {
       // 清空费用承担方名称
       this.queryParam.targetSn = undefined
       this.$refs.custList.resetForm()
     },
+    // 经销商 change
     custChange (v, obj, id) {
       this.queryParam.targetSn = v.key
       this.$refs.ruleForm.validateField('targetSn')
@@ -267,6 +273,7 @@ export default {
         }
       })
     },
+    // 获取统计数据
     getCount (params) {
       this.totalData = null
       this.totalMData = []
@@ -312,10 +319,12 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       this.getColumns()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240

+ 34 - 21
src/views/reportData/expenseAccountReport/categoryList.vue

@@ -3,7 +3,7 @@
     <a-card size="small" :bordered="false" class="searchBoxNormal">
       <div class="table-page-search-wrapper" ref="tableSearch">
         <a-form-model
-          id="returnGoodsPresentationList-form"
+          id="categoryList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -13,7 +13,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="统计月份" prop="months">
-                <a-input :value="queryParam.months?queryParam.months.join(','):''" placeholder="请选择月份(多选)" style="width: 100%;">
+                <a-input id="categoryList-months" :value="queryParam.months?queryParam.months.join(','):''" placeholder="请选择月份(多选)" style="width: 100%;">
                   <span style="cursor: pointer;" slot="addonAfter" @click="openMonth">
                     点击选择
                   </span>
@@ -22,12 +22,18 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="费用归属品类(二级)" prop="productTypeSn2">
-                <ProductType v-model="productType" :changeOnSelect="false" :level="2" @change="changeProductType" placeholder="请选择费用归属品类"></ProductType>
+                <ProductType
+                  id="categoryList-productTypeSn2"
+                  v-model="productType"
+                  :changeOnSelect="false"
+                  :level="2"
+                  @change="changeProductType"
+                  placeholder="请选择费用归属品类"></ProductType>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="returnGoodsPresentationList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="returnGoodsPresentationList-reset">重置</a-button>
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="categoryList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="categoryList-reset">重置</a-button>
               <a-button
                 style="margin-left: 5px"
                 type="primary"
@@ -36,7 +42,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 v-if="$hasPermissions('B_expenseCollectExportByPtype')"
-                id="returnGoodsPresentationList-export">导出</a-button>
+                id="categoryList-export">导出</a-button>
             </a-col>
           </a-row>
         </a-form-model>
@@ -78,45 +84,47 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import selectMonth from './selectMonth.vue'
-import { hdExportExcel } from '@/libs/exportExcel'
 import reportModal from '@/views/common/reportModal.vue'
 import ProductType from '@/views/common/productType.js'
+// 接口
 import { expenseCollectReportQueryPageByProductType, expenseCollectReportQueryCountByProductType, expenseCollectReportExportByProductType } from '@/api/reportData'
 export default {
-  name: 'AllCountryCostReportList',
+  name: 'ExpenseAccountCategoryList',
   mixins: [commonMixin],
   components: { STable, VSelect, selectMonth, ProductType, reportModal },
   data () {
     return {
       spinning: false,
-      open: false,
-      year: '',
       showExport: false, // 导出弹窗初始值
-      productType: [],
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      tableHeight: 0, // 列表高度
+      productType: [], // 产品分类
       queryParam: {
-        months: undefined,
-        productTypeSn2: undefined
+        months: undefined, // 月份
+        productTypeSn2: undefined// 产品二级分类
       },
-      addrProvinceList: [], //  省下拉
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       rules: {
         'months': [{ required: true, message: '请选择月份', trigger: 'change' }],
         'productTypeSn2': [{ required: true, message: '请选择费用归属品类(二级)', trigger: 'change' }]
       },
-      columns: [],
+      columns: [], // 表头数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         const _this = this
         _this.disabled = true
         _this.spinning = true
-        const paramsPage = Object.assign(parameter, this.queryParam) //  有分页
+        const paramsPage = Object.assign(parameter, this.queryParam)
+        // 获取列表数据 无分页
         return expenseCollectReportQueryPageByProductType(paramsPage).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -124,16 +132,17 @@ export default {
           }
           this.spinning = false
           this.disabled = false
+          // 统计
           this.getCount(paramsPage)
           return data
         })
       },
-      totalData: null,
-      totalMData: [],
-      tableHeight: 0
+      totalData: null, // 统计数据
+      totalMData: [] // 汇总数据
     }
   },
   methods: {
+    // 获取列表表头
     getColumns () {
       const _this = this
       const arr = [
@@ -218,6 +227,7 @@ export default {
     openMonth () {
       this.$refs.months.showModal(this.queryParam.months, 'm1')
     },
+    // 选择月份完成
     getDateValue (data) {
       this.queryParam.months = data
     },
@@ -238,6 +248,7 @@ export default {
         }
       })
     },
+    // 统计
     getCount (params) {
       this.totalData = null
       this.totalMData = []
@@ -283,10 +294,12 @@ export default {
         }
       })
     },
+    // 初始化
     pageInit () {
       this.getColumns()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240

+ 21 - 26
src/views/reportData/expenseAccountReport/selectMonth.vue

@@ -21,6 +21,7 @@
             :getPopupContainer="triggerNode=>triggerNode.parentNode"
             @change="selectTime"
             placeholder="请选择"
+            id="selectMonthModal-OneY"
             v-model="OneY" >
             <a-select-option v-for="(i,j) in DateList" :key="j" :value="i.TimeYear">{{ i.TimeYear }}</a-select-option>
           </a-select>
@@ -28,7 +29,7 @@
       </a-col>
       <a-col :span="19">
         <div class="conterList">
-          <a-checkbox-group v-model="optTime[curIndex].queryTime" @change="onChange" >
+          <a-checkbox-group id="selectMonthModal-queryTime" v-model="optTime[curIndex].queryTime" @change="onChange" >
             <a-checkbox
               v-for="(item,index) in DateList[curIndex].queryTime"
               :key="index"
@@ -40,22 +41,9 @@
         </div>
       </a-col>
     </a-row>
-    <!-- <a-row style="margin-top:5px;">
-      <a-col :span="24">
-        <div><label style="margin: 5px 5px 0 0;display:inline-block;"><span style="color:#f00">*</span>已选择:</label>
-          <a-tag
-            color="#40a9ff"
-            style="margin-bottom: 3px;"
-            closable
-            @close="()=>closeTime(curIndex,v)"
-            v-for="v in optTimes"
-            :key="v + '-1'">{{ v }}</a-tag>
-        </div>
-      </a-col>
-    </a-row> -->
     <div class="btn-cont">
-      <a-button @click="cancel" style="margin-right: 15px;">取消</a-button>
-      <a-button type="primary" @click="handleSubmit">确定</a-button>
+      <a-button @click="cancel" id="selectMonthModal-cancel" style="margin-right: 15px;">取消</a-button>
+      <a-button type="primary" id="selectMonthModal-submit" @click="handleSubmit">确定</a-button>
     </div>
   </a-modal>
 </template>
@@ -63,10 +51,10 @@
 export default {
   data () {
     return {
-      visible: false,
-      title: '月份选择',
-      DateList: [],
-      labelCol: {
+      visible: false, // 弹窗是否显示
+      title: '月份选择', // 弹窗标题
+      DateList: [], // 已选择月份数据
+      labelCol: {// 调整表单距离
         xs: { span: 24 },
         sm: { span: 10 }
       },
@@ -74,18 +62,18 @@ export default {
         xs: { span: 24 },
         sm: { span: 13 }
       },
-      optTime: [],
-      OneY: null,
-      curIndex: 0,
-      optTimes: null,
+      optTime: [], // 月份数据
+      OneY: null, // 选择年份
+      curIndex: 0, // 当前选中年份下标值
+      optTimes: null, // 选中的月份
       ctype: null
-
     }
   },
-  created () {
+  created () { // 初始化数据
     this.init()
   },
   methods: {
+    // 关闭弹窗
     cancel () {
       this.visible = false
     },
@@ -96,6 +84,7 @@ export default {
       this.optTimes = info || null
       if (info) this.editTime(info)
     },
+    // 初始化
     init () {
       const _this = this
       const _opt = {}
@@ -112,6 +101,7 @@ export default {
       _this.optTime = _optTime
       _this.DateList = _opt
     },
+    // 获取当前年月数据
     getDateList () {
       const Dates = new Date()
       const year = Dates.getFullYear()
@@ -122,6 +112,7 @@ export default {
       }
       return optDate.reverse()
     },
+    // 选中年份
     editTime (info) {
       const _optTime = this.optTime
       const _opt = this.optTimes.map(v => { return v.substring(0, 4) })
@@ -134,6 +125,7 @@ export default {
       }
       // console.log(_optTime,'_optTime_optTime')
     },
+    // 确定提交
     handleSubmit () {
       const _this = this
       _this.visible = false
@@ -143,11 +135,13 @@ export default {
         _this.optTime[i].queryTime = []
       }
     },
+    // 选择时间
     selectTime (info, Node) {
       const _this = this
       _this.OneY = info
       _this.curIndex = parseInt(Node.key)
     },
+    // 选择月份 change
     onChange (info) {
       const _this = this
       const _opt = _this.optTime
@@ -157,6 +151,7 @@ export default {
       }
       _this.optTimes = arr
     },
+    // 关闭时间选择弹窗
     closeTime (index, time) {
       this.optTime[index].queryTime = this.optTime[index].queryTime.filter(v => {
         return v !== time

+ 15 - 11
src/views/reportData/hPriceDifferenceDetailReport/list.vue

@@ -14,7 +14,7 @@
           <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 ref="rangeDate" id="hPriceDifferenceDetailList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -72,7 +72,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="hPriceDifferenceDetailList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="5" :sm="24">
@@ -89,7 +89,7 @@
               </a-col>
               <a-col :md="7" :sm="24" v-show="isShowCustomerSearch">
                 <a-form-model-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                  <customerService id="hPriceDifferenceDetailList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -108,7 +108,7 @@
                 class="button-warning"
                 @click="handleExport"
                 :disabled="disabled"
-                id="shortageStatisticsCList-export">导出</a-button>
+                id="hPriceDifferenceDetailList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -153,9 +153,10 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
 import Area from '@/views/common/area.js'
@@ -163,7 +164,8 @@ import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
 import BizUser from '@/views/common/bizUser.js'
 import customerService from '@/views/common/customerService'
-import { hdExportExcel } from '@/libs/exportExcel'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+// 接口
 import { headRebateDetailReportList, headRebateDetailReportCount, headRebateDetailReportExport } from '@/api/reportData'
 export default {
   name: 'HPriceDifferenceDetailReportList',
@@ -173,15 +175,17 @@ export default {
     return {
       spinning: false,
       advanced: false, // 高级搜索 展开/关闭
-      showExport: false,
-      queryParam: { //  查询条件
+      showExport: false, // 导出弹窗提示
+      //  查询条件
+      queryParam: {
+        // 日期 默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        bizNo: '',
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
+        bizNo: '', // 订单号
         dealer: {
           dealerSn: undefined,
           dealerLevel: undefined,

+ 32 - 22
src/views/reportData/priceDifferenceDetailReport/list.vue

@@ -17,6 +17,7 @@
                 <a-month-picker
                   placeholder="请选择月份"
                   locale="zh-cn"
+                  id="priceDifferenceDetailList-month"
                   v-model="queryParam.month"
                   @change="onChange"
                   :disabled-date="disabledDate"
@@ -39,9 +40,9 @@
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-              <a-form-item label="客服">
-                <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-              </a-form-item>
+              <a-form-model-item label="客服">
+                <customerService ref="customerName" id="priceDifferenceDetailList-customerName" v-model="queryParam.bizUserSn"></customerService>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="所在区域">
@@ -49,7 +50,7 @@
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-              <a-form-item label="单据类型">
+              <a-form-model-item label="单据类型">
                 <v-select
                   v-model="queryParam.bizType"
                   ref="bizType"
@@ -57,9 +58,8 @@
                   code="REBATE_BILL_BIZ_TYPE"
                   placeholder="请选择单据类型"
                   allowClear></v-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
-
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="priceDifferenceDetailList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="priceDifferenceDetailList-reset">重置</a-button>
@@ -71,7 +71,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 v-if="$hasPermissions('B_priceDifferenceDetail_Export')"
-                id="allocationDetailsList-export">导出</a-button>
+                id="priceDifferenceDetailList-export">导出</a-button>
             </a-col>
           </a-row>
         </a-form-model>
@@ -119,6 +119,8 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
@@ -127,7 +129,7 @@ import subarea from '@/views/common/subarea.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import reportModal from '@/views/common/reportModal.vue'
 import customerService from '@/views/common/customerService.vue'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { reportRebateReportList, reportRebateCount, reportRebateExport } from '@/api/reportData'
 export default {
   name: 'PriceDifferenceDetailReportList',
@@ -136,25 +138,28 @@ export default {
   data () {
     return {
       spinning: false,
-      exportLoading: false,
-      showExport: false,
-      queryParam: { //  查询条件
-        month: moment().format('YYYY-MM'),
-        provinceSn: undefined,
-        parentDealerSn: undefined,
-        buyerSn: undefined,
-        bizUserSn: undefined,
+      exportLoading: false, // 导出按钮加载状态
+      showExport: false, // 导出弹窗状态
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      //  查询条件
+      queryParam: {
+        month: moment().format('YYYY-MM'), // 月份默认值
+        provinceSn: undefined, // 省份编码
+        parentDealerSn: undefined, // 记账门店
+        buyerSn: undefined, // 客户名称 sn
+        bizUserSn: undefined, // 客服
         bizType: undefined, // 单据类型
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined// 分区
         }
       },
+      totalData: null, // 统计数据
       rules: {
         'month': [{ required: true, message: '请选择月份', trigger: 'change' }],
         'provinceSn': [{ required: true, message: '请选择省份', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -163,12 +168,14 @@ export default {
           params.month = params.month + '-01'
         }
         this.spinning = true
+        // 获取列表数据
         return reportRebateReportList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             // 总计
             this.getCount(params)
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -178,9 +185,7 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      totalData: null,
-      tableHeight: 0
+      }
     }
   },
   computed: {
@@ -204,9 +209,11 @@ export default {
     }
   },
   methods: {
+    // 月份 change
     onChange (date, dateString) {
       this.queryParam.month = dateString
     },
+    // 月份选择范围
     disabledDate (current) {
       return current && current > moment().endOf('day')
     },
@@ -237,9 +244,11 @@ export default {
         }
       })
     },
+    // 记账门店
     rebateDealerChange (val) {
       this.queryParam.parentDealerSn = val.key
     },
+    // 客户名称 change
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
@@ -280,6 +289,7 @@ export default {
         }
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200

+ 43 - 31
src/views/reportData/productRebateReport/dealerList.vue

@@ -4,7 +4,7 @@
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper" ref="tableSearch2">
         <a-form-model
-          id="rebateDetailReport-form"
+          id="productRebateDealerList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -16,17 +16,17 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="日期" prop="time">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+                <rangeDate id="productRebateDealerList-time" ref="rangeDate" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="单号">
-                <a-input id="srebateReport-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入单号"/>
+                <a-input id="productRebateDealerList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="客户名称">
-                <dealerSearchList ref="dealer" id="srebateReport-buyerName" @change="dealerChange" />
+                <dealerSearchList ref="dealer" id="productRebateDealerList-buyerName" @change="dealerChange" />
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
@@ -34,7 +34,7 @@
                 <a-form-model-item label="客户级别">
                   <v-select
                     v-model="queryParam.dealer.dealerLevel"
-                    id="srebateReport-dealerLevel"
+                    id="productRebateDealerList-dealerLevel"
                     code="DEALER_LEVEL"
                     placeholder="请选择客户级别"
                     allowClear></v-select>
@@ -42,45 +42,45 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="所在区域">
-                  <subarea id="srebateReport-subareaSn" ref="subarea" @change="subareaChange"></subarea>
+                  <subarea id="productRebateDealerList-subareaSn" ref="subarea" @change="subareaChange"></subarea>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="productRebateDealerList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="省份">
-                  <Area id="srebateReport-provinceSn" v-model="queryParam.dealer.provinceSn" placeholder="请选择省份"></Area>
+                  <Area id="productRebateDealerList-provinceSn" v-model="queryParam.dealer.provinceSn" placeholder="请选择省份"></Area>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="差价归属方">
-                  <dealerSearchList ref="parentDealer" id="srebateReport-parentDealer" @change="parentDealerChange" placeholder="请输入差价归属方"/>
+                  <dealerSearchList ref="parentDealer" id="productRebateDealerList-parentDealer" @change="parentDealerChange" placeholder="请输入差价归属方"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="差价归属类型">
-                  <v-select code="RELATION_REBATE_PARENT_TYPE" v-model="queryParam.rebateParentType" allowClear placeholder="请选择差价归属类型"></v-select>
+                  <v-select code="RELATION_REBATE_PARENT_TYPE" id="productRebateDealerList-rebateParentType" v-model="queryParam.rebateParentType" allowClear placeholder="请选择差价归属类型"></v-select>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="单据类型" prop="bizType">
-                  <a-select id="srebateReport-bizType" allowClear v-model="queryParam.bizType" placeholder="请选择单据类型">
+                  <a-select id="productRebateDealerList-bizType" allowClear v-model="queryParam.bizType" placeholder="请选择单据类型">
                     <a-select-option v-for="item in bizTypeList" :value="item.value" :key="item.value">{{ item.name }}</a-select-option>
                   </a-select>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                  <customerService id="productRebateDealerList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="rebateDetailReport-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="rebateDetailReport-reset">重置</a-button>
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="productRebateDealerList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productRebateDealerList-reset">重置</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -121,6 +121,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import dealerSearchList from '@/views/common/dealerSearchList.vue'
@@ -128,46 +129,50 @@ import subarea from '@/views/common/subarea.js'
 import Area from '@/views/common/area.js'
 import BizUser from '@/views/common/bizUser.js'
 import customerService from '@/views/common/customerService'
+// 接口
 import { productRebateParentList, productRebateParentCount } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate, dealerSearchList, subarea, Area, BizUser, customerService },
   mixins: [commonMixin],
+  name: 'ProductRebateDealerList',
   data () {
     return {
       spinning: false,
       labelCol: { span: 8 },
-      wrapperCol: { span: 16 },
+      wrapperCol: { span: 16 }, // 调整表单
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
-        bizNo: '', // 单号
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      //  查询条件
+      queryParam: {
+        time: [], // 日期
+        beginDate: '', // 开始日期
+        endDate: '', // 结束日期
+        bizNo: '', // 订单号
         buyerSn: undefined, // 客户sn
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
           bizUserSn: undefined // 区域负责人
         },
         dealer: {
-          dealerSn: undefined,
-          dealerLevel: undefined,
-          provinceSn: undefined
+          dealerSn: undefined, // 客户sn
+          dealerLevel: undefined, // 客户名称
+          provinceSn: undefined// 省份
         },
         parentDealerSn: undefined, // 差价归属方
         rebateParentType: undefined, // 差价归属类型
         bizType: undefined, // 类型
         bizUserSn: undefined // 客服类型
       },
-      bizTypeList: [
+      bizTypeList: [// 单据类型数据
         { value: 'SALES', name: '采购差价' },
         { value: 'SALES_RETURN', name: '退货差价' }
       ],
+      totalData: null, //  合计
       rules: {
         'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -176,13 +181,16 @@ export default {
         delete params.time
         // 总计
         this.getCount(params)
+        // 获取列表数据 有分页
         return productRebateParentList(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
+              // 差价归属类型 不等于 直接上级时,统计值恢复undefined
               if (data.list[i].rebateParentTypeDictValue && data.list[i].rebateParentTypeDictValue != '直接上级') {
                 data.list[i].totalAmount = undefined
                 data.list[i].totalRealAmount = undefined
@@ -194,8 +202,7 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      totalData: null //  合计
+      }
     }
   },
   computed: {
@@ -224,6 +231,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       this.setTableH()
     },
@@ -242,12 +250,13 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  日期  change
     dateChange (date) {
       this.queryParam.time = date
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 客户名称 change
     dealerChange (val) {
       if (val.row) {
         this.queryParam.buyerSn = val.row.dealerSn
@@ -255,6 +264,7 @@ export default {
         this.queryParam.buyerSn = undefined
       }
     },
+    // 区域分区
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -304,11 +314,13 @@ export default {
       this.totalData = null
       this.$refs.table.clearTable()
     },
+    // 初始化
     pageInit () {
       this.disabled = false
       this.spinning = false
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       this.$nextTick(() => { // 页面渲染完成后的回调
         const tableSearchH = this.$refs.tableSearch2.offsetHeight

+ 42 - 46
src/views/reportData/productRebateReport/detailList.vue

@@ -4,7 +4,7 @@
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper" ref="tableSearch1">
         <a-form-model
-          id="rebateDetailReport-form"
+          id="productRebateDetailList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -16,32 +16,32 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="日期" prop="time">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+                <rangeDate id="productRebateDetailList-time" ref="rangeDate" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="订单号">
-                <a-input id="srebateReport-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入订单号"/>
+                <a-input id="productRebateDetailList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入订单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="备货单号">
-                <a-input id="srebateReport-bizSubNo" v-model.trim="queryParam.bizSubNo" allowClear placeholder="请输入备货单号"/>
+                <a-input id="productRebateDetailList-bizSubNo" v-model.trim="queryParam.bizSubNo" allowClear placeholder="请输入备货单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="客户名称">
-                <dealerSearchList ref="dealer" id="srebateReport-buyerName" @change="dealerChange" />
+                <dealerSearchList ref="dealer" id="productRebateDetailList-buyerName" @change="dealerChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="差价归属方">
-                <dealerSearchList ref="parentDealer" id="srebateReport-parentDealer" @change="parentDealerChange" placeholder="请输入差价归属方"/>
+                <dealerSearchList ref="parentDealer" id="productRebateDetailList-parentDealer" @change="parentDealerChange" placeholder="请输入差价归属方"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="差价归属类型">
-                <v-select code="RELATION_REBATE_PARENT_TYPE" v-model="queryParam.rebateParentType" allowClear placeholder="请选择差价归属类型"></v-select>
+                <v-select code="RELATION_REBATE_PARENT_TYPE" id="productRebateDetailList-rebateParentType" v-model="queryParam.rebateParentType" allowClear placeholder="请选择差价归属类型"></v-select>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -49,7 +49,7 @@
                 <v-select
                   v-model="queryParam.bizType"
                   ref="bizType"
-                  id="srebateReport-bizType"
+                  id="productRebateDetailList-bizType"
                   code="REBATE_BILL_BIZ_TYPE"
                   placeholder="请选择单据类型"
                   allowClear></v-select>
@@ -57,33 +57,24 @@
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-item label="产品品牌">
-                  <ProductBrand id="rebateDetailReport-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
-                </a-form-item>
+                <a-form-model-item label="产品品牌">
+                  <ProductBrand id="productRebateDetailList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productEntity.productBrandSn"></ProductBrand>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品分类">
-                  <ProductType id="rebateDetailReport-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="queryParam.productType"></ProductType>
+                  <ProductType id="productRebateDetailList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="queryParam.productType"></ProductType>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品编码">
-                  <a-input id="rebateDetailReport-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
+                  <a-input id="productRebateDetailList-code" v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
                 </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="rebateDetailReport-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="rebateDetailReport-reset">重置</a-button>
-              <!-- <a-button
-                type="primary"
-                style="margin-left: 5px"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                v-if="$hasPermissions('M_salesReturnReportExport')"
-                class="button-warning"
-                id="rebateDetailReport-export-btn">导出</a-button> -->
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="productRebateDetailList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productRebateDetailList-reset">重置</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -124,33 +115,38 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { downloadExcel } from '@/libs/JGPrint.js'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import dealerSearchList from '@/views/common/dealerSearchList.vue'
+// 组件
 import { rebateDetailQueryList, rebateDetailQueryCount } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate, ProductType, ProductBrand, dealerSearchList },
   mixins: [commonMixin],
+  name: 'ProductRebateDetailList',
   data () {
     return {
       spinning: false,
-      labelCol: { span: 8 },
-      wrapperCol: { span: 16 },
+      labelCol: { span: 8 }, // 调整表单纵向布局
+      wrapperCol: { span: 16 }, // 调整表单横向布局
       advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        time: [], // 日期
+        beginDate: '', // 开始日期
+        endDate: '', // 结束日期
         buyerSn: undefined, // 客户sn
-        bizNo: '', // 单号
-        bizSubNo: '',
-        bizType: undefined,
-        parentDealerSn: undefined,
-        rebateParentType: undefined,
+        bizNo: '', // 单号
+        bizSubNo: '', // 备货单号
+        bizType: undefined, // 单据类型
+        parentDealerSn: undefined, // 差价归属方
+        rebateParentType: undefined, // 差价归属类型
         productEntity: {
           productBrandSn: undefined, //  产品品牌
           productTypeSn1: '', //  产品一级分类
@@ -160,11 +156,10 @@ export default {
           name: '' //  产品名称
         }
       },
+      totalData: null, //  合计
       rules: {
         'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -173,6 +168,7 @@ export default {
         delete params.time
         // 总计
         this.getCount(params)
+        // 获取列表数据 有分页
         return rebateDetailQueryList(params).then(res => {
           let data
           if (res.status == 200) {
@@ -181,17 +177,13 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               data.list[i].inStockQty = data.list[i].qty
-              // if (data.list[i].parentDealerName) {
-              //   data.list[i].parentDealerName += '(' + data.list[i].rebateRate * 100 + '%)'
-              // }
             }
             this.disabled = false
           }
           this.spinning = false
           return data
         })
-      },
-      totalData: null //  合计
+      }
     }
   },
   computed: {
@@ -225,6 +217,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭 监听表格高度变化
     advanced (newValue, oldValue) {
       this.setTableH()
     },
@@ -247,7 +240,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  日期  change
     dateChange (date) {
       this.queryParam.time = date
       this.queryParam.beginDate = date[0] || ''
@@ -264,6 +257,7 @@ export default {
         }
       })
     },
+    // 客户名称
     dealerChange (val) {
       if (val.row) {
         this.queryParam.buyerSn = val.row.dealerSn
@@ -271,6 +265,7 @@ export default {
         this.queryParam.buyerSn = undefined
       }
     },
+    // 差价归属方
     parentDealerChange (val) {
       if (val.row) {
         this.queryParam.parentDealerSn = val.row.dealerSn
@@ -311,15 +306,16 @@ export default {
       this.queryParam.productEntity.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productEntity.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 初始化
     pageInit () {
       this.disabled = false
       this.spinning = false
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       this.$nextTick(() => { // 页面渲染完成后的回调
         const tableSearchH = this.$refs.tableSearch1.offsetHeight
-        console.log(tableSearchH)
         this.tableHeight = window.innerHeight - tableSearchH - 300
       })
     }

+ 5 - 6
src/views/reportData/productRebateReport/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="tabsReportList-wrap">
     <div style="background-color: #fff;margin-bottom: 5px;">
+      <!-- 选项卡 1订单差价表 2订单经销商差价表 3产品差价表 -->
       <a-tabs default-active-key="1" v-model="curTab" @change="changeTab">
         <a-tab-pane key="1" tab="订单差价表"></a-tab-pane>
         <a-tab-pane key="2" tab="订单经销商差价表"></a-tab-pane>
@@ -16,22 +17,20 @@
 </template>
 
 <script>
+// 引入组件
 import report from './list.vue'
 import detailReport from './detailList.vue'
 import dealerReport from './dealerList.vue'
 export default {
   name: 'ProductRebateReportIndex',
-  components: {
-    report,
-    detailReport,
-    dealerReport
-  },
+  components: { report, detailReport, dealerReport },
   data () {
     return {
-      curTab: '1'
+      curTab: '1'// 切换tab值
     }
   },
   methods: {
+    // 选项卡切换 事件
     changeTab (v) {
       if (v == 2) {
         this.$refs.dealerList.setTableH()

+ 28 - 50
src/views/reportData/productRebateReport/list.vue

@@ -4,7 +4,7 @@
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form-model
-          id="srebateReport-form"
+          id="productRebateReportList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -16,17 +16,17 @@
           <a-row :gutter="15">
             <a-col :md="5" :sm="24">
               <a-form-model-item label="日期" prop="time">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+                <rangeDate id="productRebateReportList-time" ref="rangeDate" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-model-item label="订单号">
-                <a-input id="srebateReport-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入订单号"/>
+                <a-input id="productRebateReportList-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入订单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
               <a-form-model-item label="客户名称">
-                <dealerSearchList ref="dealer" id="srebateReport-buyerName" @change="dealerChange" />
+                <dealerSearchList ref="dealer" id="productRebateReportList-buyerName" @change="dealerChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -34,24 +34,15 @@
                 <v-select
                   v-model="queryParam.bizType"
                   ref="bizType"
-                  id="srebateReport-bizType"
+                  id="productRebateReportList-bizType"
                   code="REBATE_BILL_BIZ_TYPE"
                   placeholder="请选择单据类型"
                   allowClear></v-select>
               </a-form-model-item>
             </a-col>
             <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="srebateReport-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="srebateReport-reset">重置</a-button>
-              <!-- <a-button
-                type="primary"
-                style="margin-left: 5px"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                v-if="$hasPermissions('M_salesReturnReportExport')"
-                class="button-warning"
-                id="srebateReport-export-btn">导出</a-button> -->
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="productRebateReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productRebateReportList-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form-model>
@@ -68,6 +59,7 @@
             dropdownMatchSelectWidth
             :maxTagCount="3"
             :tree-data="colsArr"
+            id="productRebateReportList-isShowColumn"
             tree-checkable
             placeholder="请选择要显示的列(多选)"
           />
@@ -102,10 +94,11 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-// import { downloadExcel } from '@/libs/JGPrint.js'
 import dealerSearchList from '@/views/common/dealerSearchList.vue'
+// 接口
 import { rebateQueryList, rebateQueryCount } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate, dealerSearchList },
@@ -114,22 +107,23 @@ export default {
     return {
       spinning: false,
       labelCol: { span: 8 },
-      wrapperCol: { span: 16 },
+      wrapperCol: { span: 16 }, // 表单调整
       advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        time: [], // 日期
+        beginDate: '', // 开始日期
+        endDate: '', // 结束日期
         buyerSn: undefined, // 客户sn
-        bizNo: '', // 单号
-        bizType: undefined
+        bizNo: '', // 单号
+        bizType: undefined// 单据类型
       },
       rules: {
         'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -138,6 +132,7 @@ export default {
         delete params.time
         // 总计
         this.getCount(params)
+        // 获取表格数据 有分页
         return rebateQueryList(params).then(res => {
           let data
           if (res.status == 200) {
@@ -153,7 +148,7 @@ export default {
         })
       },
       totalData: null, //  合计
-      colsArr: [
+      colsArr: [ // 显示列数据
         {
           title: '直接差价金额(明细)',
           value: 'directRebateAmountInfo',
@@ -167,7 +162,7 @@ export default {
           disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice')
         }
       ],
-      showCols: []
+      showCols: []// 已选显示列数据
     }
   },
   computed: {
@@ -209,7 +204,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  日期  change
     dateChange (date) {
       this.queryParam.time = date
       this.queryParam.beginDate = date[0] || ''
@@ -226,6 +221,7 @@ export default {
         }
       })
     },
+    // 客户名称 change
     dealerChange (val) {
       if (val.row) {
         this.queryParam.buyerSn = val.row.dealerSn
@@ -247,32 +243,14 @@ export default {
       this.totalData = null
       this.$refs.table.clearTable()
     },
-    // 导出
-    // handleExport () {
-    //   const _this = this
-    //   this.$refs.ruleForm.validate(valid => {
-    //     if (valid) {
-    //       const params = _this.queryParam
-    //       params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
-    //       _this.exportLoading = true
-    //       _this.spinning = true
-    //       reportSalesReturnExport(params).then(res => {
-    //         downloadExcel(res, '销售退货报表')
-    //         _this.exportLoading = false
-    //         _this.spinning = false
-    //       })
-    //     } else {
-    //       console.log('error submit!!')
-    //       return false
-    //     }
-    //   })
-    // },
+    // 表格高度自适应
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 210
     }
   },
   watch: {
+    //  展开关闭 监听列表高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 38 - 28
src/views/reportData/promotionSalesOrderReport/list.vue

@@ -16,6 +16,7 @@
               <a-form-model-item label="统计月份" prop="monthInfo">
                 <div class="monthBox" style="display:flex;align-item:center;">
                   <a-month-picker
+                    id="promotionSalesList-startValue"
                     :disabled-date="disabledStartDate"
                     format="YYYY-MM"
                     v-model="startValue"
@@ -25,6 +26,7 @@
                   />
                   <span>~</span>
                   <a-month-picker
+                    id="promotionSalesList-endValue"
                     :disabled-date="disabledEndDate"
                     format="YYYY-MM"
                     v-model="endValue"
@@ -38,12 +40,12 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="区域/分区">
-                <subarea id="promotionSalesList-allocateTypeSn" ref="subarea" @change="subareaChange"></subarea>
+                <subarea id="promotionSalesList-subareaSn" ref="subarea" @change="subareaChange"></subarea>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="区域负责人">
-                <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                <BizUser id="promotionSalesList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
               </a-form-model-item>
             </a-col>
             <a-form-model-item label="省份">
@@ -56,7 +58,7 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="客户级别">
+                <a-form-model-item label="客户级别">
                   <v-select
                     v-model="queryParam.dealerLevel"
                     ref="dealerLevel"
@@ -64,15 +66,15 @@
                     code="DEALER_LEVEL"
                     placeholder="请选择客户级别"
                     allowClear></v-select>
-                </a-form-item>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="产品品牌">
+                <a-form-model-item label="产品品牌">
                   <ProductBrand id="productInfoList-productBrand" v-model="queryParam.productBrand"></ProductBrand>
-                </a-form-item>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="产品分类">
+                <a-form-model-item label="产品分类">
                   <productTypeAll
                     expandType="click"
                     :changeOnSelect="false"
@@ -81,7 +83,7 @@
                     @change="changeProductType"
                     v-model="productType"
                     id="productInfoList-productType"></productTypeAll>
-                </a-form-item>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align:center;margin-bottom: 10px;">
@@ -194,15 +196,17 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import ProductBrand from '@/views/common/productBrand.js'
 import productTypeAll from '@/views/common/productType.js'
-import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
 import Area from '@/views/common/area.js'
 import BizUser from '@/views/common/bizUser.js'
-import { hdExportExcel } from '@/libs/exportExcel'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+// 接口
 import { brandTypeReportList, brandTypeReportCount, brandTypeReportExport } from '@/api/reportData'
 export default {
   name: 'PromotionSalesOrderReport',
@@ -212,35 +216,36 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
-        brandTypeBeginDate: moment().format('YYYYMM'),
-        brandTypeEndDate: moment().format('YYYYMM'),
-        dealerSn: undefined,
-        provinceSn: undefined,
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      showExport: false, // 导出弹窗
+      //  查询条件
+      queryParam: {
+        brandTypeBeginDate: moment().format('YYYYMM'), // 开始月份
+        brandTypeEndDate: moment().format('YYYYMM'), // 结束月份
+        dealerSn: undefined, // 客户 sn
+        provinceSn: undefined, // 省份
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
-          bizUserSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
+          bizUserSn: undefined// 区域负责人
         },
-        productBrand: undefined,
+        productBrand: undefined, // 产品品牌
         productTypeSn1: '', //  产品一级分类
         productType: '', //  产品二级分类
-        dealerLevel: undefined
+        dealerLevel: undefined// 客户等级
       },
-      productType: [],
+      productType: [], // 产品分类
       form: {
         monthInfo: [moment().format('YYYY-MM'), moment().format('YYYY-MM')]
       },
       rules: {
         monthInfo: [{ required: true, message: '请选择统计月份', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      startValue: moment().format('YYYY-MM'), // 统计月份
-      endValue: moment().format('YYYY-MM'),
-      endOpen: false,
+      startValue: moment().format('YYYY-MM'), // 统计月份 开始
+      endValue: moment().format('YYYY-MM'), // 统计月份 结束
+      endOpen: false, // 打开结束月份弹窗
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -251,11 +256,13 @@ export default {
         if (!paramsPage.subareaArea.subareaSn && !paramsPage.subareaArea.subareaAreaSn && !paramsPage.subareaArea.bizUserSn) {
           delete paramsPage.subareaArea
         }
+        // 获取列表数据  有分页
         return brandTypeReportList(paramsPage).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             this.getCount(paramsPage)
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -304,6 +311,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -384,6 +392,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       if (!_this.form.monthInfo[0] || !_this.form.monthInfo[1]) {
@@ -439,6 +448,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.refresh()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 38 - 28
src/views/reportData/promotionSalesRealTimeReport/index.vue

@@ -5,21 +5,23 @@
         <a-tab-pane key="1" tab="促销销售单报表">
           <a-card size="small" :bordered="false" class="promotionSalesRealTimeReport-wrap searchBoxNormal">
             <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
+              <!-- 查询条件 -->
               <a-form-model
                 layout="inline"
                 ref="ruleForm"
+                id="promotionSalesRealTimeReport-form"
                 :rules="rules"
                 :model="queryParam">
                 <a-row :gutter="15">
                   <a-col :md="6" :sm="24">
                     <a-form-model-item label="销售审核时间" prop="salesDate">
-                      <rangeDate ref="rangeDate" :value="queryParam.salesDate" @change="salesDateChange" />
+                      <rangeDate ref="rangeDate" id="promotionSalesRealTimeReport-salesDate" :value="queryParam.salesDate" @change="salesDateChange" />
                     </a-form-model-item>
                   </a-col>
                   <a-col :md="6" :sm="24">
-                    <!-- :disabledDate="disabledDate" -->
                     <a-form-model-item label="促销开始时间">
                       <a-range-picker
+                        id="promotionSalesRealTimeReport-time"
                         style="width:100%"
                         v-model="time"
                         :format="dateFormat"
@@ -103,15 +105,15 @@
                       </a-form-model-item>
                     </a-col>
                     <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-                      <a-form-item label="客服">
-                        <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-                      </a-form-item>
+                      <a-form-model-item label="客服">
+                        <customerService id="promotionSalesRealTimeReport-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                      </a-form-model-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" :disabled="disabled" @click="testForm('search')" >查询</a-button>
-                      <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm">重置</a-button>
+                      <a-button type="primary" id="promotionSalesRealTimeReport-refresh" :disabled="disabled" @click="testForm('search')" >查询</a-button>
+                      <a-button style="margin-left: 8px" id="promotionSalesRealTimeReport-reset" :disabled="disabled" @click="resetSearchForm">重置</a-button>
                       <a-button
                         style="margin-left: 10px"
                         type="primary"
@@ -119,6 +121,7 @@
                         @click="testForm('export')"
                         :disabled="disabled"
                         :loading="exportLoading"
+                        id="promotionSalesRealTimeReport-export"
                         v-if="$hasPermissions('B_promotionSalesExport')"
                       >导出</a-button>
                       <a @click="advanced=!advanced" style="margin-left: 8px">
@@ -195,17 +198,18 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import reportModal from '@/views/common/reportModal.vue'
-import { salesPromoReportList, salesPromoReportQueryCount, exportSalesPromoReport } from '@/api/reportData'
-import { hdExportExcel } from '@/libs/exportExcel'
 import gatherList from './list'
 import rangeDate from '@/views/common/rangeDate.vue'
-import getDate from '@/libs/getDate.js'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
 import customerService from '@/views/common/customerService'
-// import moment from 'moment'
+// 接口
+import { salesPromoReportList, salesPromoReportQueryCount, exportSalesPromoReport } from '@/api/reportData'
 export default {
   name: 'PriceDifferenceDetailReportList',
   mixins: [commonMixin],
@@ -213,10 +217,11 @@ export default {
   data () {
     const _this = this
     return {
-      advanced: true, // 高级搜索 展开/关闭
-      time: undefined,
       spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      time: undefined, // 促销开始时间
       queryParam: {
+        // 促销审核时间默认值
         salesDate: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
@@ -234,25 +239,25 @@ export default {
         buyerLevel: undefined, // 客户级别
         buyerName: '', // 客户名称
         subareaArea: {
-          subareaSn: '',
-          subareaAreaSn: ''
+          subareaSn: '', // 区域
+          subareaAreaSn: ''// 分区
         },
         dealerProvinceSn: undefined, // 省份编码
         dealerCitySn: undefined, // 城市编码
         dealerDistrictSn: undefined, // 区域编码
-        giveMoney: undefined,
+        giveMoney: undefined, // 采购额
         bizUserSn: undefined// 客服
       },
       rules: {
         salesDate: [{ required: true, message: '请选择销售审核时间', trigger: 'change' }]
       },
-      dateFormat: 'YYYY-MM-DD',
-      tabVal: 1,
-      disabled: false,
-      tableHeight: 0,
+      dateFormat: 'YYYY-MM-DD', // 时间格式
+      tabVal: 1, // tab值  1促销销售单报表 2促销销售单实时报表
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
       totalData: null, //  合计
-      exportLoading: false,
-      showExport: false,
+      exportLoading: false, // 导出按钮加载状态
+      showExport: false, // 导出弹窗
       columns: [
         { title: '促销名称', dataIndex: 'promotion.title', width: '160px', align: 'left', customRender: function (text) { return text || '--' }, fixed: 'left', ellipsis: true },
         { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '130px', align: 'center', fixed: 'left' },
@@ -287,10 +292,12 @@ export default {
         const newParams = JSON.parse(JSON.stringify(params))
         delete newParams.salesDate
         this.spinning = true
+        // 促销销售单报表  列表  有分页
         return salesPromoReportList(newParams).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 序号计算
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -304,6 +311,7 @@ export default {
     }
   },
   methods: {
+    // 销售审核时间  change
     salesDateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.salesDate = date
@@ -313,6 +321,7 @@ export default {
       this.queryParam.beginAuditDate = date[0] || ''
       this.queryParam.endAuditDate = date[1] || ''
     },
+    // 促销开始时间  change
     dateChange (date, dateString) {
       this.time = date
       if (dateString[0] != '' && dateString[1] != '') {
@@ -323,10 +332,6 @@ export default {
         this.$set(this.queryParam.promoRuleReport, 'promotionDateEnd', undefined)
       }
     },
-    // // 不可选日期
-    // disabledDate (date, dateStrings) {
-    //   return date && date.valueOf('day') < moment().subtract(1, 'day') // 今天以后,包含今天
-    // },
     // 统计
     getCount (params) {
       salesPromoReportQueryCount(params).then(res => {
@@ -337,11 +342,12 @@ export default {
         }
       })
     },
+    // 区域分区
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
-    // tab
+    // tab 切换 change
     handleChange (val) {
       this.tabVal = val
     },
@@ -379,6 +385,7 @@ export default {
         }
       })
     },
+    // 地区
     areaChange (val) {
       this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
       this.queryParam.dealerCitySn = val[1] ? val[1] : ''
@@ -387,9 +394,9 @@ export default {
     // 查询
     handleSearch () {
       const _this = this
-      // 总计
       const paramData = JSON.parse(JSON.stringify(this.queryParam))
       delete paramData.salesDate
+      // 获取统计数据
       _this.getCount(paramData)
       _this.$refs.table.refresh(true)
     },
@@ -430,18 +437,21 @@ export default {
       this.$refs.table.clearTable()
       this.totalData = null
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 260
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 55 - 61
src/views/reportData/promotionSalesRealTimeReport/list.vue

@@ -2,21 +2,22 @@
   <a-spin :spinning="spinning" tip="Loading...">
     <div class="productInfoList-wrap">
       <a-card size="small" :bordered="false" class="searchBoxNormal">
+        <!-- 查询 -->
         <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
-          <a-form-model layout="inline" ref="ruleForm" :rules="rules" :model="newQueryParam">
+          <a-form-model id="promotionSalesRealTimeList-form" layout="inline" ref="ruleForm" :rules="rules" :model="newQueryParam">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="下推时间" prop="salesDate">
-                  <rangeDate ref="rangeDate" :value="newQueryParam.salesDate" @change="salesDateChange" />
+                  <rangeDate id="promotionSalesRealTimeList-salesDate" ref="rangeDate" :value="newQueryParam.salesDate" @change="salesDateChange" />
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <!-- :disabledDate="disabledDate" -->
                 <a-form-model-item label="促销开始时间">
                   <a-range-picker
                     style="width:100%"
                     v-model="time"
                     :format="dateFormat"
+                    id="promotionSalesRealTimeList-time"
                     :placeholder="['开始时间', '结束时间']"
                     @change="dateChange"></a-range-picker>
                 </a-form-model-item>
@@ -24,7 +25,7 @@
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="促销名称">
                   <a-input
-                    id="promotionSalesRealTimeReport-title"
+                    id="promotionSalesRealTimeList-title"
                     v-model.trim="newQueryParam.promoRuleReport.title"
                     allowClear
                     placeholder="请输入促销名称" />
@@ -36,7 +37,7 @@
                     <v-select
                       v-model="newQueryParam.promoRuleReport.promotionRuleType"
                       ref="ruleType"
-                      id="promotionSalesRealTimeReport-ruleType"
+                      id="promotionSalesRealTimeList-ruleType"
                       code="PROMOTION_RULE_TYPE"
                       placeholder="请选择促销类型"
                       allowClear></v-select>
@@ -45,7 +46,7 @@
                 <a-col :md="6" :sm="24">
                   <a-form-model-item label="规则">
                     <a-input
-                      id="promotionSalesRealTimeReport-ruleInfo"
+                      id="promotionSalesRealTimeList-ruleInfo"
                       v-model.trim="newQueryParam.promoRuleReport.ruleInfo"
                       allowClear
                       placeholder="请输入规则关键字" />
@@ -54,7 +55,7 @@
                 <a-col :md="6" :sm="24">
                   <a-form-model-item label="销售单号">
                     <a-input
-                      id="promotionSalesRealTimeReport-salesBillNo"
+                      id="promotionSalesRealTimeList-salesBillNo"
                       v-model.trim="newQueryParam.salesBillNo"
                       allowClear
                       placeholder="请输入销售单号" />
@@ -65,7 +66,7 @@
                     <v-select
                       v-model="newQueryParam.buyerLevel"
                       ref="buyerLevel"
-                      id="promotionSalesRealTimeReport-buyerLevel"
+                      id="promotionSalesRealTimeList-buyerLevel"
                       code="DEALER_LEVEL"
                       placeholder="请选择客户级别"
                       allowClear></v-select>
@@ -74,7 +75,7 @@
                 <a-col :md="6" :sm="24">
                   <a-form-model-item label="客户名称">
                     <a-input
-                      id="promotionSalesRealTimeReport-buyerName"
+                      id="promotionSalesRealTimeList-buyerName"
                       v-model.trim="newQueryParam.buyerName"
                       allowClear
                       placeholder="请输入客户名称" />
@@ -82,24 +83,24 @@
                 </a-col>
                 <a-col :md="6" :sm="24">
                   <a-form-model-item label="所在区域">
-                    <subarea ref="subarea" id="promotionSalesRealTimeReport-subarea" @change="subareaChange"></subarea>
+                    <subarea ref="subarea" id="promotionSalesRealTimeList-subarea" @change="subareaChange"></subarea>
                   </a-form-model-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
                   <a-form-model-item label="地区">
-                    <AreaList id="promotionSalesRealTimeReport-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                    <AreaList id="promotionSalesRealTimeList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
                   </a-form-model-item>
                 </a-col>
                 <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-                  <a-form-item label="客服">
-                    <customerService ref="customerName" v-model="newQueryParam.bizUserSn"></customerService>
-                  </a-form-item>
+                  <a-form-model-item label="客服">
+                    <customerService ref="customerName" id="promotionSalesRealTimeList-customerName" v-model="newQueryParam.bizUserSn"></customerService>
+                  </a-form-model-item>
                 </a-col>
               </template>
               <a-col :md="6" :sm="24">
                 <span class="table-page-search-submitButtons">
-                  <a-button type="primary" :disabled="disabled" @click="testForm('search')">查询</a-button>
-                  <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm">重置</a-button>
+                  <a-button type="primary" id="promotionSalesRealTimeList-refresh":disabled="disabled" @click="testForm('search')">查询</a-button>
+                  <a-button style="margin-left: 8px" id="promotionSalesRealTimeList-reset" :disabled="disabled" @click="resetSearchForm">重置</a-button>
                   <a-button
                     style="margin-left: 10px"
                     type="primary"
@@ -107,6 +108,7 @@
                     @click="testForm('export')"
                     :disabled="disabled"
                     :loading="exportLoading"
+                    id="promotionSalesRealTimeList-export"
                     v-if="$hasPermissions('B_promotionSalesExport')">导出</a-button>
                   <a @click="advanced=!advanced" style="margin-left: 8px">
                     {{ advanced ? '收起' : '展开' }}
@@ -179,51 +181,38 @@
 </template>
 
 <script>
-import {
-  commonMixin
-} from '@/utils/mixin'
-import {
-  salesPromoRealReportList,
-  salesPromoRealReportCount,
-  exportSalesPromoRealReport
-} from '@/api/reportData'
-import {
-  hdExportExcel
-} from '@/libs/exportExcel'
-import {
-  STable,
-  VSelect
-} from '@/components'
+import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+import getDate from '@/libs/getDate.js'
+// 组件
+import { STable, VSelect } from '@/components'
 import reportModal from '@/views/common/reportModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 import customerService from '@/views/common/customerService.vue'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
-import getDate from '@/libs/getDate.js'
+// 接口
+import { salesPromoRealReportList, salesPromoRealReportCount, exportSalesPromoRealReport } from '@/api/reportData'
 export default {
-  name: 'QueryPart',
+  name: 'PromotionSalesRealTimeList',
   mixins: [commonMixin],
-  components: {
-    STable,
-    VSelect,
-    reportModal,
-    AreaList,
-    rangeDate,
-    subarea,
-    customerService
-  },
+  components: { STable, VSelect, reportModal, AreaList, rangeDate, subarea, customerService },
   data () {
     const _this = this
     return {
-      advanced: true, // 高级搜索 展开/关闭
-      time: undefined,
       spinning: false,
-      disabled: false,
-      tableHeight: 0,
-      newQueryParam: { // 查询条件
+      advanced: true, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      exportLoading: false, // 导出按钮加载状态
+      showExport: false, // 导出弹窗
+      time: undefined, // 促销开始时间
+      // 查询条件
+      newQueryParam: {
+        // 下推时间 默认值
         salesDate: [
-          getDate.getCurrMonthDays().starttime,
-          getDate.getCurrMonthDays().endtime
+          getDate.getCurrMonthDays().starttime, // 下推开始时间
+          getDate.getCurrMonthDays().endtime// 下推结束时间
         ],
         beginAuditDate: getDate.getCurrMonthDays().starttime, // 审核开始时间
         endAuditDate: getDate.getCurrMonthDays().endtime, // 审核结束时间
@@ -238,25 +227,20 @@ export default {
         buyerLevel: undefined, // 客户级别
         buyerName: '', // 客户名称
         subareaArea: {
-          subareaSn: '',
-          subareaAreaSn: ''
+          subareaSn: '', // 区域
+          subareaAreaSn: ''// 分区
         },
         dealerProvinceSn: undefined, // 省份编码
         dealerCitySn: undefined, // 城市编码
         dealerDistrictSn: undefined, // 区域编码
-        bizUserSn: undefined
+        bizUserSn: undefined// 客服
       },
       rules: {
-        salesDate: [{
-          required: true,
-          message: '请选择下推时间',
-          trigger: 'change'
-        }]
+        salesDate: [{ required: true, message: '请选择下推时间', trigger: 'change' }]
       },
-      dateFormat: 'YYYY-MM-DD',
-      totalData: null, //  合计
-      exportLoading: false,
-      showExport: false,
+      dateFormat: 'YYYY-MM-DD', // 时间格式
+      totalData: null, //  统计合计
+      // 表格列
       columns: [{
         title: '促销名称',
         dataIndex: 'promotion.title',
@@ -430,10 +414,12 @@ export default {
         this.spinning = true
         this.disabled = true
         const params = Object.assign(parameter, this.newQueryParam)
+        // 促销销售单实时报表 列表  有分页
         return salesPromoRealReportList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 计算列表序号
             for (var i = 0; i < data.length; i++) {
               data[i].no = i + 1
             }
@@ -446,6 +432,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -457,6 +444,7 @@ export default {
     }
   },
   methods: {
+    // 下推时间 change
     salesDateChange (date) {
       if (date[0] && date[1]) {
         this.newQueryParam.salesDate = date
@@ -466,11 +454,13 @@ export default {
       this.newQueryParam.beginAuditDate = date[0] || ''
       this.newQueryParam.endAuditDate = date[1] || ''
     },
+    // 地区
     areaChange (val) {
       this.newQueryParam.dealerProvinceSn = val[0] ? val[0] : ''
       this.newQueryParam.dealerCitySn = val[1] ? val[1] : ''
       this.newQueryParam.dealerDistrictSn = val[2] ? val[2] : ''
     },
+    // 促销开始时间
     dateChange (date, dateString) {
       this.time = date
       if (dateString[0] != '' && dateString[1] != '') {
@@ -481,6 +471,7 @@ export default {
         this.$set(this.newQueryParam.promoRuleReport, 'promotionDateEnd', undefined)
       }
     },
+    // 区域分区
     subareaChange (val) {
       this.newQueryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.newQueryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -536,6 +527,7 @@ export default {
         _this.showExport = true
       })
     },
+    // 重置
     resetSearchForm () {
       this.$refs.ruleForm.resetFields()
       this.newQueryParam = {
@@ -571,12 +563,14 @@ export default {
       this.$refs.table.clearTable()
       this.totalData = null
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 260

+ 36 - 24
src/views/reportData/receivedSendStorageReport/index.vue

@@ -1,10 +1,12 @@
 <template>
   <div>
     <a-card size="small" :bordered="false" class="receivedSendStorageReport-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
         <a-form-model
           layout="inline"
           ref="ruleForm"
+          id="receivedSendStorageReport-form"
           :rules="rules"
           :model="form">
           <a-row :gutter="15">
@@ -16,6 +18,7 @@
                     format="YYYY-MM"
                     v-model="startValue"
                     placeholder="开始月份"
+                    id="receivedSendStorageReport-startTime"
                     @openChange="handleStartOpenChange"
                     @change="getStartDate"
                   />
@@ -24,6 +27,7 @@
                     :disabled-date="disabledEndDate"
                     format="YYYY-MM"
                     v-model="endValue"
+                    id="receivedSendStorageReport-endTime"
                     placeholder="结束月份"
                     :open="endOpen"
                     @openChange="handleEndOpenChange"
@@ -54,7 +58,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="仓库">
-                <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
+                <chooseWarehouse ref="warehouse" id="receivedSendStorageReport-warehouseSn" v-model="queryParam.warehouseSn"></chooseWarehouse>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -67,7 +71,7 @@
                 @click="testForm('export')"
                 :disabled="disabled"
                 v-if="$hasPermissions('B_ProductPriceExoprt')"
-                id="productInfoList-export">导出</a-button>
+                id="receivedSendStorageReport-export">导出</a-button>
             </a-col>
           </a-row>
         </a-form-model>
@@ -125,50 +129,52 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+import moment from 'moment'
+// 组件
+import { STable, VSelect } from '@/components'
 import ProductBrand from '@/views/common/productBrand.js'
 import productTypeAll from '@/views/common/productTypeAll.js'
-import { STable, VSelect } from '@/components'
 import reportModal from '@/views/common/reportModal.vue'
-import { queryDetailReportPage, exportDetailReport, queryReportCount } from '@/api/reportData'
-import { hdExportExcel } from '@/libs/exportExcel'
 import gatherList from './list'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
-import moment from 'moment'
+// 接口
+import { queryDetailReportPage, exportDetailReport, queryReportCount } from '@/api/reportData'
 export default {
-  name: 'PriceDifferenceDetailReportList',
+  name: 'ReceivedSendStorageReportList',
   mixins: [commonMixin],
   components: { STable, VSelect, ProductBrand, gatherList, productTypeAll, reportModal, chooseWarehouse },
   data () {
     return {
       moment,
+      disabled: false, // 查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出提示框
       queryParam: {
-        beginDate: undefined,
-        endDate: undefined,
+        beginDate: undefined, // 开始周期
+        endDate: undefined, // 结束周期
         product: {
           name: '', // 产品名称
           code: ''// 产品编码
         },
-        productBrandSn: undefined,
-        productTypeSn1: undefined,
-        productTypeSn2: undefined,
-        productTypeSn3: undefined,
-        warehouseSn: undefined
+        productBrandSn: undefined, // 产品品牌
+        productTypeSn1: undefined, // 产品一级分类
+        productTypeSn2: undefined, // 产品二级分类
+        productTypeSn3: undefined, // 产品三级分类
+        warehouseSn: undefined// 出库仓库
       },
       form: {
-        time: []
+        time: []// 选择周期
       },
-      totalData: null,
-      tabVal: 1,
+      totalData: null, // 统计数据
+      tabVal: 1, // tabs  切换值
+      productType: [], // 产品分类
       rules: {
         time: [{ required: true, message: '请选择月份', trigger: 'change' }]
       },
-      productType: [],
-      disabled: false,
-      tableHeight: 0,
-      endOpen: false,
-      showExport: false,
-      startValue: null,
-      endValue: null,
+      endOpen: false, // 结束月份弹窗
+      startValue: null, // 开始月份有效值
+      endValue: null, // 结束月份有效值
       columns: [
         { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -196,10 +202,12 @@ export default {
         this.disabled = true
         const params = Object.assign(parameter, this.queryParam)
         this.spinning = true
+        // 获取列表数据  有分页
         return queryDetailReportPage(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
@@ -213,6 +221,7 @@ export default {
     }
   },
   methods: {
+    // 统计
     getCount (params) {
       queryReportCount(params).then(res => {
         if (res.status == 200) {
@@ -262,6 +271,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 选项卡 change
     handleChange (val) {
       this.tabVal = val
     },
@@ -325,12 +335,14 @@ export default {
       this.totalData = null
       this.$refs.gatherBox.resetTable()
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 255

+ 11 - 6
src/views/reportData/receivedSendStorageReport/list.vue

@@ -42,25 +42,26 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { queryGroupByprodTypeReportPage } from '@/api/reportData'
+// 组件
 import { STable, VSelect } from '@/components'
+// 接口
+import { queryGroupByprodTypeReportPage } from '@/api/reportData'
 export default {
-  name: 'QueryPart',
+  name: 'ReceivedSendStorageList',
   mixins: [commonMixin],
   components: { STable, VSelect },
   props: {
-    newLoading: Boolean,
-    queryParam: {
+    queryParam: {// 查询参数
       type: Object,
       default: function () {
         return {}
       }
     },
-    tableHeight: {
+    tableHeight: {// 表格高度
       type: Number,
       default: 0
     },
-    totalData: {
+    totalData: {// 合计数据
       type: Object,
       default: function () {
         return null
@@ -91,10 +92,12 @@ export default {
       loadData: parameter => {
         this.disabled = true
         const params = Object.assign(parameter, this.queryParam)
+        // 获取列表数据 无分页
         return queryGroupByprodTypeReportPage(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 获取列表序号
             for (var i = 0; i < data.length; i++) {
               data[i].no = i + 1
             }
@@ -107,6 +110,7 @@ export default {
     }
   },
   methods: {
+    // 初始化
     pageInit (buyerSn) {
       this.resetCurForm()
     },
@@ -114,6 +118,7 @@ export default {
     resetCurForm () {
       this.$refs.table.refresh()
     },
+    // 清除表格内容
     resetTable () {
       this.$refs.table.clearTable()
     }

+ 41 - 40
src/views/reportData/regionTypeSalesReport/list.vue

@@ -1,14 +1,16 @@
 <template>
   <div>
     <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 选项卡切换 -->
       <a-tabs v-model="activeKey" @change="callback" :tabBarStyle="{'background':'#fff'}">
         <a-tab-pane :key="item.id" :tab="item.name" v-for="item in tabsList">
         </a-tab-pane>
       </a-tabs>
       <a-card size="small">
+        <!-- 搜索条件 -->
         <div class="table-page-search-wrapper newTableSearchName" ref="tableSearch">
           <a-form-model
-            id="returnGoodsPresentationList-form"
+            id="regionTypeSalesList-form"
             ref="ruleForm"
             class="form-model-con"
             layout="inline"
@@ -18,12 +20,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="regionTypeSalesList-time" ref="rangeDate" :value="queryParam.time" @change="dateChange"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="销售状态" prop="salesStatusType">
                   <v-select
+                    id="regionTypeSalesList-salesStatusType"
                     v-model="queryParam.salesStatusType"
                     code="SALES_STATUS"
                     placeholder="请选择销售状态"
@@ -32,29 +35,22 @@
               </a-col>
               <a-col :md="6" :sm="24" v-if="activeKey==0">
                 <a-form-model-item label="所在区域">
-                  <subarea id="returnGoodsPresentationList-subareaSn" ref="subarea" @change="subareaChange"></subarea>
+                  <subarea id="regionTypeSalesList-subarea" ref="subarea" @change="subareaChange"></subarea>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="regionTypeSalesList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-                <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-                </a-form-item>
-              </a-col>
-              <!--  <template v-if="advanced && activeKey==0">
-              <a-col :md="6" :sm="24">
-                <a-form-model-item prop="dealerProvinceSn" style="margin: 0;" label="地区">
-                  <Area id="returnGoodsPresentationList-dealerProvinceSn" v-model="queryParam.dealerProvinceSn" placeholder="请选择省"></Area>
+                <a-form-model-item label="客服">
+                  <customerService id="regionTypeSalesList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-model-item>
               </a-col>
-            </template> -->
               <a-col :md="(activeKey==0&&!isShowCustomerSearch)?24:activeKey==1&&isShowCustomerSearch?24:6" :sm="24" style="margin-bottom: 10px;" :style="{textAlign:(activeKey==0&&!isShowCustomerSearch)?'center':(activeKey==1&&isShowCustomerSearch)?'center':'left'}">
-                <a-button type="primary" @click="handleSearch" :disabled="disabled" id="returnGoodsPresentationList-refresh">查询</a-button>
-                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="returnGoodsPresentationList-reset">重置</a-button>
+                <a-button type="primary" @click="handleSearch" :disabled="disabled" id="regionTypeSalesList-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="regionTypeSalesList-reset">重置</a-button>
                 <a-button
                   style="margin-left: 5px"
                   type="primary"
@@ -63,7 +59,7 @@
                   :disabled="disabled"
                   :loading="exportLoading"
                   v-if="$hasPermissions('B_regionTypeSalesReportExport')"
-                  id="returnGoodsPresentationList-export">导出</a-button>
+                  id="regionTypeSalesList-export">导出</a-button>
               </a-col>
             </a-row>
           </a-form-model>
@@ -82,7 +78,7 @@
           :data="loadData"
           :showPagination="false"
           :style="{ height: tableHeight+84.5+'px' }"
-          :scroll="{ x:1550,y: tableHeight}"
+          :scroll="{ x:1550,y: tableHeight +30}"
           bordered>
         </s-table>
       </a-card>
@@ -94,45 +90,46 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import Area from '@/views/common/area.js'
 import subarea from '@/views/common/subarea.js'
 import BizUser from '@/views/common/bizUser.js'
-import { hdExportExcel } from '@/libs/exportExcel'
 import reportModal from '@/views/common/reportModal.vue'
 import customerService from '@/views/common/customerService.vue'
+// 接口
 import { realReportSalesByProvince, realReportSalesByProvinceExport, subareaAreaReportTitle, subareaReportTitle, realReportSalesBySubArea, realReportSalesBySubAreaExport } from '@/api/reportData.js'
 export default {
   name: 'RegionTypeSalesReportList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, Area, reportModal, BizUser, customerService },
+  components: { STable, VSelect, rangeDate, subarea, reportModal, BizUser, customerService },
   data () {
     return {
       spinning: false,
-      tabsList: [{ id: 0, name: '各分区品类实售明细' }, { id: 1, name: '各区域品类实售明细' }],
-      salesStatusTypeList: [{ code: 'SALES', name: '实售销售' }, { code: 'SALES_RETURN', name: '实售退货' }, { code: 'REAL_SALES', name: '实际销售' }],
-      activeKey: 0,
+      activeKey: 0, // 切换显示页面值 0 各分区品类实售明细 1各区域品类实售明细
       advanced: true, // 高级搜索 展开/关闭
-      showExport: false,
-      columns: [],
-      totalData: null,
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      tableHeight: 0, // 表格高度
+      tabsList: [{ id: 0, name: '各分区品类实售明细' }, { id: 1, name: '各区域品类实售明细' }], // tab切换data
+      salesStatusTypeList: [{ code: 'SALES', name: '实售销售' }, { code: 'SALES_RETURN', name: '实售退货' }, { code: 'REAL_SALES', name: '实际销售' }],
+      columns: [], // 表头数据
+      totalData: null, // 统计
+      // 查询参数
       queryParam: {
-        time: [],
-        beginDate: '',
-        endDate: '',
-        dealerProvinceSn: undefined,
+        time: [], // 默认时间
+        beginDate: '', // 开始时间
+        endDate: '', // 结束时间
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
-          bizUserSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
+          bizUserSn: undefined// 区域负责人
         },
-        salesStatusType: 'REAL_SALES',
-        bizUserSn: undefined
+        salesStatusType: 'REAL_SALES', // 销售状态
+        bizUserSn: undefined// 客服
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      tableHeight: 0,
       rules: {
         'time': [{ required: true, message: '请选择时间', trigger: 'change' }],
         'salesStatusType': [{ required: true, message: '请选择销售状态', trigger: 'change' }]
@@ -141,8 +138,9 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const paramsPage = Object.assign(this.queryParam) //  无分页
+        const paramsPage = Object.assign(this.queryParam)
         const jkUrl = this.activeKey == 0 ? realReportSalesByProvince : realReportSalesBySubArea
+        // 获取列表数据 无分页 0各分区品类实售明细列表 1各区域品类实售明细列表
         return jkUrl(paramsPage).then(res => {
           let data
           if (res.status == 200) {
@@ -159,6 +157,7 @@ export default {
     }
   },
   methods: {
+    // tabs切换  change时间
     callback (key) {
       this.activeKey = key
       const _this = this
@@ -189,6 +188,7 @@ export default {
         }
       })
     },
+    // 区域分区
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -200,7 +200,6 @@ export default {
       this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
-      this.queryParam.dealerProvinceSn = undefined
       this.queryParam.subareaArea.subareaSn = undefined
       this.queryParam.subareaArea.subareaAreaSn = undefined
       this.queryParam.subareaArea.bizUserSn = undefined
@@ -254,11 +253,13 @@ export default {
       })
       this.resetSearchForm()
     },
+    // 初始化
     pageInit () {
       this.activeKey = 0
       this.getTableTitle()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 250

+ 40 - 28
src/views/reportData/returnGoodsPresentation/list.vue

@@ -14,13 +14,12 @@
           <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 ref="rangeDate" id="returnGoodsPresentationList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="客户名称">
-                <dealerSubareaScopeList id="salesPresentationList-dealerSn" ref="custList" @change="custChange"></dealerSubareaScopeList>
-                <!-- <a-input id="returnGoodsPresentationList-dealerName" v-model.trim="queryParam.dealer.dealerName" allowClear placeholder="请输入客户名称"/> -->
+                <dealerSubareaScopeList id="returnGoodsPresentationList-dealerSn" ref="custList" @change="custChange"></dealerSubareaScopeList>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -48,7 +47,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="returnGoodsPresentationList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -124,6 +123,8 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
@@ -131,7 +132,7 @@ import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
 import BizUser from '@/views/common/bizUser.js'
 import reportModal from '@/views/common/reportModal.vue'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { returnDocReportTitle, reportSalesReturnThjdReportList, reportSalesReturnThjdReportCount, reportSalesReturnThjdReportExport } from '@/api/reportData'
 export default {
   name: 'ReturnGoodsPresentationList',
@@ -141,44 +142,48 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      showExport: false,
-      queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
-        salesReturnBillNo: '',
+      showExport: false, // 导出提示框
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        time: [], // 退货日期
+        beginDate: '', // 开始日期
+        endDate: '', // 结束日期
+        salesReturnBillNo: '', // 退货单号
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
-          bizUserSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分期
+          bizUserSn: undefined// 区域负责人
         },
         dealer: {
-          'dealerSn': '',
-          'provinceSn': undefined,
-          'citySn': undefined,
-          'districtSn': undefined,
-          'dealerLevel': undefined
+          'dealerSn': '', // 客户名称
+          'provinceSn': undefined, // 省
+          'citySn': undefined, // 市
+          'districtSn': undefined, // 区
+          'dealerLevel': undefined// 客户级别
         }
       },
-      tableHeight: 0,
-      columns: [],
-      countLabel: [],
-      countBrandLabel: [],
+      columns: [], // 表头数据
+      countLabel: [], // 统计分类数据
+      countBrandLabel: [], // 统计品牌数据
       rules: {
-        'time': [{ required: true, message: '请选择调拨日期', trigger: 'change' }]
+        'time': [{ required: true, message: '请选择退货日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize })
+        // 获取列表数据 有分页
         return reportSalesReturnThjdReportList(paramsPage).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(paramsPage)
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -193,6 +198,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭,监听表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -235,6 +241,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -246,10 +253,11 @@ export default {
         }
       })
     },
+    // 客户名称
     custChange (val) {
       this.queryParam.dealer.dealerSn = val.key
     },
-    //  创建时间  change
+    //  退货日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -259,6 +267,7 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 区域分期 change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -291,6 +300,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 地区
     areaChange (val) {
       this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
       this.queryParam.dealer.citySn = val[1] ? val[1] : ''
@@ -318,10 +328,12 @@ export default {
       })
       this.resetSearchForm()
     },
+    // 初始化
     pageInit () {
       this.getTableTitle()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 49 - 38
src/views/reportData/returnSlipReport/list.vue

@@ -14,7 +14,7 @@
           <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 ref="rangeDate" id="returnSlipReportList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -36,9 +36,9 @@
 
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-item label="退货单号">
+                <a-form-model-item label="退货单号">
                   <a-input id="returnSlipReportList-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入退货单号"/>
-                </a-form-item>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="所在区域">
@@ -47,7 +47,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="returnSlipReportList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -60,7 +60,7 @@
                   <v-select
                     v-model="queryParam.goodFlag"
                     ref="goodFlag"
-                    id="returnSchedule-goodFlag"
+                    id="returnSlipReportList-goodFlag"
                     code="GOOD_FLAG"
                     placeholder="请选择退货类别"
                     allowClear></v-select>
@@ -70,16 +70,16 @@
                 <a-form-model-item label="退货类型">
                   <v-select
                     v-model="queryParam.salesReturnType"
-                    id="departUser-salesReturnType"
+                    id="returnSlipReportList-salesReturnType"
                     code="SALES_RETURN_TYPE"
                     placeholder="请选择退货类型"
                     allowClear></v-select>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-                <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-                </a-form-item>
+                <a-form-model-item label="客服">
+                  <customerService id="returnSlipReportList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -149,6 +149,8 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
@@ -157,7 +159,7 @@ import reportModal from '@/views/common/reportModal.vue'
 import AreaList from '@/views/common/areaList.js'
 import BizUser from '@/views/common/bizUser.js'
 import customerService from '@/views/common/customerService'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { salesReportReturnTitle, salesReportReturnBillList, salesReportReturnBillCount, returnSlipExport } from '@/api/reportData'
 export default {
   name: 'ReturnSlipReportList',
@@ -167,38 +169,37 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      //  查询条件
+      queryParam: {
+        // 退货日期 默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        dealerSn: undefined,
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
+        dealerSn: undefined, // 客户名称 sn
+        provinceSn: undefined, // 省编码
+        citySn: undefined, // 市编码
+        districtSn: undefined, // 区编码
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
-          bizUserSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
+          bizUserSn: undefined// 区域负责人
         },
-        dealerLevel: undefined,
-        salesReturnType: undefined,
-        goodFlag: undefined,
-        salesReturnBillNo: '',
+        dealerLevel: undefined, // 客户等级
+        salesReturnType: undefined, // 退货类型
+        goodFlag: undefined, // 退货类别
+        salesReturnBillNo: '', // 退货单号
         bizUserSn: undefined// 客服
       },
       rules: {
         'time': [{ required: true, message: '请选择退货日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false, // 导出loading
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -206,13 +207,16 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 380
         }
-        const params = Object.assign(parameter, this.queryParam) //  无分页
+        const params = Object.assign(parameter, this.queryParam)
         delete params.time
+        // 获取列表数据  有分页
         return salesReportReturnBillList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(params)
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -223,14 +227,15 @@ export default {
           return data
         })
       },
-      totalData: null,
-      columns: [],
-      countLabel: [],
-      countBrandLabel: [],
-      tableWidth: 0
+      totalData: null, // 总计
+      columns: [], // 表头数据
+      countLabel: [], // 统计分类数据
+      countBrandLabel: [], // 统计 品牌数据
+      tableWidth: 0// 表格宽度
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -272,6 +277,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -283,7 +289,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  退货日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -293,9 +299,11 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 客户名称 change
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
+    // 区域分期
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -330,6 +338,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 地区
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
@@ -357,10 +366,12 @@ export default {
       })
       this.resetSearchForm()
     },
+    // 初始化
     pageInit () {
       this.getTableTitle()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 44 - 30
src/views/reportData/salesAmountReport/list.vue

@@ -14,7 +14,7 @@
           <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 ref="rangeDate" id="salesAmountReportList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -27,7 +27,7 @@
                 <v-select
                   v-model="queryParam.dealerLevel"
                   ref="dealerLevel"
-                  id="salesAmountReportList-allocateTypeSn"
+                  id="salesAmountReportList-dealerLevel"
                   code="DEALER_LEVEL"
                   placeholder="请选择客户级别"
                   allowClear></v-select>
@@ -36,12 +36,12 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="所在区域">
-                  <subarea id="salesAmountReportList-allocateTypeSn" ref="subarea" @change="subareaChange"></subarea>
+                  <subarea id="salesAmountReportList-subareaSn" ref="subarea" @change="subareaChange"></subarea>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="salesAmountReportList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -51,7 +51,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="salesAmountReportList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-item>
               </a-col>
             </template>
@@ -123,17 +123,19 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
 import AreaList from '@/views/common/areaList.js'
 import BizUser from '@/views/common/bizUser.js'
 import customerService from '@/views/common/customerService'
-import { hdExportExcel } from '@/libs/exportExcel'
-import { salesKdxxReportTitle, salesBillReportGroupByBuyerList, salesBillReportCountByBuyer } from '@/api/salesBillReport'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+// 接口
 import { salesAmountExport } from '@/api/reportData'
+import { salesKdxxReportTitle, salesBillReportGroupByBuyerList, salesBillReportCountByBuyer } from '@/api/salesBillReport'
 export default {
   name: 'SalesAmountReportList',
   mixins: [commonMixin],
@@ -142,45 +144,51 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      //  查询条件
+      queryParam: {
+        // 默认下推时间
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        dealerSn: undefined,
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
-        dealerLevel: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
+        dealerSn: undefined, // 客户sn
+        provinceSn: undefined, // 省份
+        citySn: undefined, // 市
+        districtSn: undefined, // 区
+        dealerLevel: undefined, // 客户等级
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
-          bizUserSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
+          bizUserSn: undefined// 区域负责人
         },
         bizUserSn: undefined// 客服
       },
-      columns: [],
-      countLabel: [],
-      countBrandLabel: [],
+      totalData: null, // 统计数据
+      columns: [], // 列表表头
+      countLabel: [], // 统计分类数据
+      countBrandLabel: [], // 统计品牌数据
       rules: {
         'time': [{ required: true, message: '请选择下推时间', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize })
+        // 获取列表数据 有分页
         return salesBillReportGroupByBuyerList(paramsPage).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(paramsPage)
+            // 计算序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -190,11 +198,12 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      totalData: null
+      }
+
     }
   },
   watch: {
+    // 展开收起
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -236,6 +245,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -247,7 +257,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  下推时间  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -257,9 +267,11 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 客户名称 change
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
+    // 区域分区  change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -291,6 +303,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 地区
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
@@ -318,6 +331,7 @@ export default {
       })
       this.resetSearchForm()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 49 - 43
src/views/reportData/salesDetails/list.vue

@@ -4,7 +4,7 @@
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper" ref="tableSearch">
         <a-form-model
-          id="salesSlipReportList-form"
+          id="salesDetailsList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -14,7 +14,7 @@
           <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 ref="rangeDate" id="salesDetailsList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -71,7 +71,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="出库仓库">
-                  <chooseWarehouse ref="warehouse" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
+                  <chooseWarehouse id="salesDetailsList-warehouseSn" ref="warehouse" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -81,7 +81,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="salesDetailsList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -91,7 +91,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="促销产品">
-                  <a-select v-model="queryParam.giftFLag" placeholder="请选择促销产品" allowClear>
+                  <a-select id="salesDetailsList-giftFlag" v-model="queryParam.giftFLag" placeholder="请选择促销产品" allowClear>
                     <a-select-option value="1">
                     </a-select-option>
@@ -103,7 +103,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品类型" prop="promotionFlag">
-                  <a-select allowClear v-model.trim="queryParam.promotionFlag" :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
+                  <a-select id="salesDetailsList-promotionFlag" allowClear v-model.trim="queryParam.promotionFlag" :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
                     <a-select-option value="0">
                       正常产品
                     </a-select-option>
@@ -123,9 +123,9 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-                <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-                </a-form-item>
+                <a-form-model-item label="客服">
+                  <customerService id="salesDetailsList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="isShowCustomerSearch?24:6" :sm="24" style="margin-bottom: 10px;" :style="{textAlign: isShowCustomerSearch?'center':''}">
@@ -196,18 +196,20 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import custList from '@/views/common/custList.vue'
-import reportModal from '@/views/common/reportModal.vue'
 import AreaList from '@/views/common/areaList.js'
+import reportModal from '@/views/common/reportModal.vue'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import customerService from '@/views/common/customerService'
 import BizUser from '@/views/common/bizUser.js'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { reportSalesBillDetailList, reportSalesBillDetailCount, reportSalesBillDetailExport } from '@/api/reportData'
 export default {
   name: 'SalesDetailsList',
@@ -217,55 +219,61 @@ export default {
     return {
       spinning: false,
       advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出加载状态
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出提示弹窗
+      //  查询条件
+      queryParam: {
+        // 默认时间
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        salesBillNo: '',
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
+        salesBillNo: '', // 销售单号
         dispatchBillNo: '', // 备货单号
-        productCode: '',
-        productName: '',
-        dealerName: '',
-        dealerLevel: undefined,
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        dealerName: '', // 客户名称
+        dealerLevel: undefined, // 客户等价
         productBrandTypeSn: undefined,
         productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
-          bizUserSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
+          bizUserSn: undefined// 区域负责人
         },
-        dealerProvinceSn: undefined,
-        dealerCitySn: undefined,
-        dealerCountySn: undefined,
-        warehouseSn: undefined,
-        giftFLag: undefined,
-        promotionFlag: undefined,
+        dealerProvinceSn: undefined, // 省
+        dealerCitySn: undefined, // 市
+        dealerCountySn: undefined, // 区
+        warehouseSn: undefined, // 出库仓库
+        giftFLag: undefined, // 是否是促销产品  1是  0不是
+        promotionFlag: undefined, // 产品类型
         bizUserSn: undefined // 客服
       },
-      productType: [],
+      productType: [], // 产品分类
+      totalData: null, // 统计数据
       rules: {
         'time': [{ required: true, message: '请选择下推时间', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
+        // 查询列表
         return reportSalesBillDetailList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计查询
             this.getCount(params)
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -275,8 +283,7 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      totalData: null
+      }
     }
   },
   computed: {
@@ -338,6 +345,7 @@ export default {
     }
   },
   watch: {
+    // 展开收起
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -349,10 +357,6 @@ export default {
     }
   },
   methods: {
-    // 盘点库存日期
-    handleStock () {
-      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
-    },
     // 总计
     getCount (params) {
       reportSalesBillDetailCount(params).then(res => {
@@ -363,6 +367,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -374,7 +379,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  下推时间  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -384,9 +389,7 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
-    custChange (val) {
-      this.queryParam.dealerSn = val.key
-    },
+    //  区域  change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -456,11 +459,13 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 地区  change
     areaChange (val) {
       this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
       this.queryParam.dealerCitySn = val[1] ? val[1] : ''
       this.queryParam.dealerCountySn = val[2] ? val[2] : ''
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -468,6 +473,7 @@ export default {
       })
       _this.resetSearchForm()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 56 - 101
src/views/reportData/salesOrderTotal/list.vue

@@ -14,7 +14,7 @@
           <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 ref="rangeDate" id="salesOrderTotalList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -83,25 +83,19 @@
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区" prop="dealerProvinceSn">
                   <Area
-                    id="salesOrderTotalList-shippingAddrProvinceSn"
+                    id="salesOrderTotalList-dealerProvinceSn"
                     defValKey="id"
                     v-model="queryParam.dealerProvinceSn"
                     placeholder="请选择省"></Area>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-                <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-                </a-form-item>
+                <a-form-model-item label="客服">
+                  <customerService id="salesOrderTotalList-bizUserSn" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="isShowCustomerSearch?24:6" :sm="24" style="margin-bottom: 10px;" :style="{textAlign: isShowCustomerSearch?'center':''}">
-              <!-- <a-button
-                type="primary"
-                class="button-info"
-                size="small"
-                @click="handleStock"
-                id="salesOrderTotalList-stockDate">盘点区间日期</a-button> -->
               <a-button
                 style="margin-left: 5px"
                 type="primary"
@@ -141,6 +135,7 @@
             style="min-width: 200px"
             dropdownMatchSelectWidth
             :maxTagCount="3"
+            id="salesOrderTotalList-isShowColumn"
             :tree-data="colsArr"
             tree-checkable
             placeholder="请选择要显示的列(多选)"
@@ -182,87 +177,67 @@
 </template>
 
 <script>
-import {
-  commonMixin
-} from '@/utils/mixin'
+import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
-import {
-  STable,
-  VSelect
-} from '@/components'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
+import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import custList from '@/views/common/custList.vue'
 import reportModal from '@/views/common/reportModal.vue'
 import customerService from '@/views/common/customerService.vue'
 import Area from '@/views/common/area.js'
-import {
-  hdExportExcel
-} from '@/libs/exportExcel'
-import {
-  userQueryList
-} from '@/api/power-user'
-import {
-  reportSalesBillList,
-  reportSalesBillCount,
-  reportSalesBillExport
-} from '@/api/reportData'
+// 接口
+import { userQueryList } from '@/api/power-user'
+import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from '@/api/reportData'
 export default {
   name: 'SalesOrderTotalList',
   mixins: [commonMixin],
-  components: {
-    STable,
-    VSelect,
-    rangeDate,
-    custList,
-    subarea,
-    reportModal,
-    Area,
-    customerService
-  },
+  components: { STable, VSelect, rangeDate, custList, subarea, reportModal, Area, customerService },
   data () {
     return {
       spinning: false,
       advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      exportLoading: false, //  导出按钮加载状态
+      showExport: false, // 导出到下载中心弹窗
+      //  查询参数
+      queryParam: {
+        // 默认时间
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        salesBillNo: '',
-        dealerName: '',
-        dealerLevel: undefined,
-        operatorSn: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
+        salesBillNo: '', // 销售单号
+        dealerName: '', // 客户名称
+        dealerLevel: undefined, // 客户级别
+        operatorSn: undefined, // 操作员sn
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined// 分区
         },
-        dealerProvinceSn: undefined,
-        bizUserSn: undefined
-      },
-      rules: {
-        'time': [{
-          required: true,
-          message: '请选择下推时间',
-          trigger: 'change'
-        }]
+        dealerProvinceSn: undefined, // 省份
+        bizUserSn: undefined// 客服
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
+      rules: { 'time': [{ required: true, message: '请选择下推时间', trigger: 'change' }] }, // 查询时间必选项
+
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
+        // 列表查询
         return reportSalesBillList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计查询
             this.getCount(params)
+            // 计算序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -273,9 +248,9 @@ export default {
           return data
         })
       },
-      totalData: null,
+      totalData: null, // 合计统计
       operatorList: [], //  操作员下拉数据
-      addrProvinceList: [], //  省下拉
+      // 列表列显示
       colsArr: [
         {
           title: '直接差价金额(明细)',
@@ -290,7 +265,7 @@ export default {
           disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice')
         }
       ],
-      showCols: []// 需要显示
+      showCols: []// 已勾选显示的
     }
   },
   computed: {
@@ -318,8 +293,8 @@ export default {
         // { title: '返利', dataIndex: 'rebateAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '折扣金额', dataIndex: 'totalDiscountAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '折后金额', dataIndex: 'totalDiscountedAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-
       ]
+      // 根据权限及勾选按原型图固定顺序动态显示列
       if (this.$hasPermissions('M_salesOrderTotalList_salesPrice')) {
         arr.push({ title: '实售金额', dataIndex: 'totalRealAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '开单金额', dataIndex: 'totalAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
@@ -328,15 +303,7 @@ export default {
         arr.push({ title: '成本金额', dataIndex: 'totalCost', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '成本金额(促)', dataIndex: 'totalGiftCost', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         if (this.$hasPermissions('M_salesOrderTotalList_salesPrice')) {
-          arr.push({
-            title: '毛利',
-            dataIndex: 'grossProfit',
-            width: 70,
-            align: 'right',
-            customRender: function (text) {
-              return ((text || text == 0) ? _this.toThousands(text) : '--')
-            }
-          })
+          arr.push({ title: '毛利', dataIndex: 'grossProfit', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         }
       }
       if (this.$hasPermissions('M_salesOrderTotalList_provincePrice')) {
@@ -363,23 +330,13 @@ export default {
         arr.push({ title: '间接差价金额', dataIndex: 'reportRebateAmountInfo.indirectRebateAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '返利', dataIndex: 'reportRebateAmountInfo.rebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '优惠金额', dataIndex: 'discountAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        // arr.push({ title: '折扣金额', dataIndex: 'totalDiscountAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        // arr.push({ title: '折后金额', dataIndex: 'totalDiscountedAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-      arr.push({
-        title: '操作员',
-        dataIndex: 'operatorName',
-        width: 100,
-        align: 'center',
-        customRender: function (text) {
-          return text || '--'
-        },
-        ellipsis: true
-      })
+      arr.push({ title: '操作员', dataIndex: 'operatorName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
       return arr
     }
   },
   watch: {
+    // 展开收起
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -391,10 +348,6 @@ export default {
     }
   },
   methods: {
-    // 盘点库存日期
-    handleStock () {
-      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
-    },
     // 总计
     getCount (params) {
       reportSalesBillCount(params).then(res => {
@@ -405,6 +358,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -416,7 +370,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  下推时间  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -426,14 +380,12 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
-    custChange (val) {
-      this.queryParam.dealerSn = val.key
-    },
+    // 所在区域查询
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
-    //  重置
+    //  重置列表
     resetSearchForm () {
       this.queryParam.time = [
         getDate.getCurrMonthDays().starttime,
@@ -477,12 +429,7 @@ export default {
         }
       })
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
-    // 操作员
+    // 操作员列表获取 无分页
     getUserList () {
       userQueryList({}).then(res => {
         if (res.status == 200) {
@@ -492,6 +439,13 @@ export default {
         }
       })
     },
+    // 操作员列名称筛选
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 初始化
     pageInit () {
       const _this = this
       _this.getUserList()
@@ -499,6 +453,7 @@ export default {
         _this.setTableH()
       })
     },
+    // 计算页面高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 252

+ 3 - 2
src/views/reportData/salesPresentation/list.vue

@@ -14,7 +14,7 @@
           <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 ref="rangeDate" id="salesPresentationList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -47,7 +47,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="salesPresentationList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -122,6 +122,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'

+ 116 - 39
src/views/reportData/salesReturnDetailReport/list.vue

@@ -4,7 +4,7 @@
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper" ref="tableSearch">
         <a-form-model
-          id="salesSlipReportList-form"
+          id="salesReturnDetailList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -14,7 +14,7 @@
           <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 ref="rangeDate" id="salesReturnDetailList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -71,7 +71,7 @@
               </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="salesReturnDetailList-warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -81,7 +81,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="salesReturnDetailList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -94,7 +94,7 @@
                   <v-select
                     v-model="queryParam.goodFlag"
                     ref="goodFlag"
-                    id="returnSchedule-goodFlag"
+                    id="salesReturnDetailList-goodFlag"
                     code="GOOD_FLAG"
                     placeholder="请选择退货类别"
                     allowClear></v-select>
@@ -104,16 +104,16 @@
                 <a-form-model-item label="退货类型">
                   <v-select
                     v-model="queryParam.salesReturnType"
-                    id="departUser-salesReturnType"
+                    id="salesReturnDetailList-salesReturnType"
                     code="SALES_RETURN_TYPE"
                     placeholder="请选择退货类型"
                     allowClear></v-select>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-                <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-                </a-form-item>
+                <a-form-model-item label="客服">
+                  <customerService id="salesReturnDetailList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="isShowCustomerSearch?24:6" :sm="24" style="margin-bottom: 10px;" :style="{textAlign: isShowCustomerSearch?'center':''}">
@@ -146,6 +146,20 @@
     <!-- 列表 -->
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
+        <div style="text-align:right;margin-bottom:10px;">
+          <span>显示:</span>
+          <a-tree-select
+            size="small"
+            v-model="showCols"
+            style="min-width: 200px"
+            dropdownMatchSelectWidth
+            :maxTagCount="3"
+            :tree-data="colsArr"
+            id="salesReturnDetailList-isShowColumn"
+            tree-checkable
+            placeholder="请选择要显示的列(多选)"
+          />
+        </div>
         <s-table
           class="sTable fixPagination"
           ref="table"
@@ -156,13 +170,22 @@
           :data="loadData"
           :pageSize="30"
           :style="{ height: tableHeight+70+'px' }"
-          :scroll="{ x: 2960, y: tableHeight - 60 }"
+          :scroll="{ x: 2960, y: tableHeight - 100 }"
           :defaultLoadData="false"
           bordered>
+          <!-- 产品编码 -->
+          <template slot="productCode" slot-scope="text, record">
+            <span style="margin-right:15px;">{{ record.productCode }}</span>
+            <a-badge count="折" :number-style="{ zoom:'80%' }" v-if="record.priceSetFlag==='PRICE_SET_FLAG_DISCOUNT'"></a-badge>
+          </template>
           <template slot="footer">
             <a-row :gutter="15">
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">开单退货金额:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? toThousands(totalData.totalPrice) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')&&showCols.includes('priceOrig')">退货开单金额(折前):{{ (totalData && (totalData.totalAmountOrig || totalData.totalAmountOrig==0)) ? toThousands(totalData.totalAmountOrig) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">实售退货金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')&&showCols.includes('realSalePriceOrig')">退货实售金额(折前):{{ (totalData && (totalData.totalRealAmountOrig || totalData.totalRealAmountOrig==0)) ? toThousands(totalData.totalRealAmountOrig) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">直接差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? toThousands(totalData.directRebateAmount) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">间接差价金额:{{ (totalData && (totalData.indirectRebateAmount || totalData.indirectRebateAmount==0)) ? toThousands(totalData.indirectRebateAmount) : '--' }}</a-col>
               <a-col :md="4" :sm="24">仓库实收数量:{{ (totalData && (totalData.receiveQty || totalData.receiveQty==0)) ? totalData.receiveQty : '--' }}</a-col>
               <a-col :md="4" :sm="24">坏件数量:{{ (totalData && (totalData.totalBadQty || totalData.totalBadQty==0)) ? totalData.totalBadQty : '--' }}</a-col>
               <a-col :md="4" :sm="24">良品数量:{{ (totalData && (totalData.goodQty || totalData.goodQty==0)) ? totalData.goodQty : '--' }}</a-col>
@@ -185,6 +208,8 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
@@ -195,7 +220,7 @@ import customerService from '@/views/common/customerService'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
 import BizUser from '@/views/common/bizUser.js'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { reportSalesReturnDetailList, reportSalesReturnDetailCount, reportSalesReturnDetailExport } from '@/api/reportData'
 export default {
   name: 'SalesReturnDetailReportList',
@@ -205,55 +230,59 @@ export default {
     return {
       spinning: false,
       advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        // 退货完成日期 默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        salesReturnBillNo: '',
-        productCode: '',
-        productName: '',
-        dealerName: '',
-        dealerLevel: undefined,
-        goodFlag: undefined,
-        salesReturnType: undefined,
-        productBrandTypeSn: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
+        salesReturnBillNo: '', // 退货单号
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        dealerName: '', // 客户名称
+        dealerLevel: undefined, // 客户等级
+        goodFlag: undefined, // 退货类别
+        salesReturnType: undefined, // 退货类型
+        productBrandTypeSn: undefined, // 品牌分类
         productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        warehouseSn: undefined,
+        warehouseSn: undefined, // 出库仓库
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
-          bizUserSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
+          bizUserSn: undefined// 区域负责人
         },
-        dealerProvinceSn: undefined,
-        dealerCitySn: undefined,
-        dealerCountySn: undefined,
-        bizUserSn: undefined
+        dealerProvinceSn: undefined, // 省
+        dealerCitySn: undefined, // 市
+        dealerCountySn: undefined, // 区
+        bizUserSn: undefined// 客服
       },
-      productType: [],
       rules: {
         'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
+        // 获取列表数据 有分页
         return reportSalesReturnDetailList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(params)
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -264,7 +293,36 @@ export default {
           return data
         })
       },
-      totalData: null
+      productType: [], // 产品分类
+      totalData: null, // 统计数据
+      // 列表列显示
+      showCols: [], // 已勾选的列
+      colsArr: [
+        {
+          title: '退货开单价(折前)',
+          value: 'priceOrig',
+          key: 'priceOrig',
+          disabled: !this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')
+        },
+        {
+          title: '退货实售价(折前)',
+          value: 'realSalePriceOrig',
+          key: 'realSalePriceOrig',
+          disabled: !this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')
+        },
+        {
+          title: '直接差价(折前)',
+          value: 'directRebatePriceOrig',
+          key: 'directRebatePriceOrig',
+          disabled: !this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')
+        },
+        {
+          title: '间接差价(折前)',
+          value: 'indirectRebatePriceOrig',
+          key: 'indirectRebatePriceOrig',
+          disabled: !this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')
+        }
+      ]
     }
   },
   computed: {
@@ -285,7 +343,7 @@ export default {
         { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', scopedSlots: { customRender: 'productCode' }, width: 150, align: 'center' },
 
         { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '退货原因', dataIndex: 'returnReason', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
@@ -312,8 +370,14 @@ export default {
       }
       if (this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')) { //  售价权限
         arr.push({ title: '退货开单价', dataIndex: 'price', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.showCols.includes('priceOrig')) {
+          arr.push({ title: '退货开单价(折前)', dataIndex: 'priceOrig', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
         arr.push({ title: '退货开单金额', dataIndex: 'totalPrice', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '退货实售价', dataIndex: 'realPrice', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.showCols.includes('realSalePriceOrig')) {
+          arr.push({ title: '退货实售价(折前)', dataIndex: 'realSalePriceOrig', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
         arr.push({ title: '退货实售金额', dataIndex: 'totalRealAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       if (this.$hasPermissions('M_salesReturnDetailReportList_cityPrice')) {
@@ -321,7 +385,13 @@ export default {
       }
       if (this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')) {
         arr.push({ title: '直接差价', dataIndex: 'reportRebateAmountInfo.directRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.showCols.includes('directRebatePriceOrig')) {
+          arr.push({ title: '直接差价(折前)', dataIndex: 'directRebateAmountOrig', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
         arr.push({ title: '间接差价', dataIndex: 'reportRebateAmountInfo.indirectRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.showCols.includes('indirectRebatePriceOrig')) {
+          arr.push({ title: '间接差价(折前)', dataIndex: 'indirectRebateAmountOrig', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
         arr.push({ title: '直接上级差价金额', dataIndex: 'reportRebateAmountInfo.directRebateUpAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '间接上级差价金额', dataIndex: 'reportRebateAmountInfo.indirectRebateUpAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '指定差价金额', dataIndex: 'reportRebateAmountInfo.assignRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
@@ -344,6 +414,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -369,6 +440,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -380,7 +452,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  退货完成日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -390,6 +462,7 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 客户名称 change
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
@@ -419,6 +492,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 区域分区  change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -461,18 +535,21 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 地区
     areaChange (val) {
       this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
       this.queryParam.dealerCitySn = val[1] ? val[1] : ''
       this.queryParam.dealerCountySn = val[2] ? val[2] : ''
     },
+    // 初始化
     pageInit () {
       this.resetSearchForm()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 200
+      this.tableHeight = window.innerHeight - tableSearchH - 230
     }
   },
   mounted () {

+ 39 - 30
src/views/reportData/salesReturnReport/list.vue

@@ -14,7 +14,7 @@
           <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="salesReturnReportList-time" ref="rangeDate" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -41,7 +41,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="salesReturnReportList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -51,7 +51,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="salesReturnDetailList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
                 </a-form-item>
               </a-col>
             </template>
@@ -122,6 +122,8 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
@@ -130,7 +132,7 @@ import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
 import BizUser from '@/views/common/bizUser.js'
 import customerService from '@/views/common/customerService'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { salesReportReturnRebateTitle, salesReportReturnRebateList, salesReportReturnRebateCount, salesReturnExport } from '@/api/reportData'
 
 export default {
@@ -141,46 +143,48 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态loading
+      //  查询条件
+      queryParam: {
+        // 退货日期 默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        dealerSn: undefined,
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
+        dealerSn: undefined, // 客户名称
+        provinceSn: undefined, // 省编码
+        citySn: undefined, // 市编码
+        districtSn: undefined, // 区编码
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
-          bizUserSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
+          bizUserSn: undefined// 区域负责人
         },
-        dealerLevel: undefined,
-        bizUserSn: undefined
+        dealerLevel: undefined, // 客户级别
+        bizUserSn: undefined// 客服
       },
       rules: {
         'time': [{ required: true, message: '请选择退货日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false, // 导出loading
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [], //  区下拉
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const params = Object.assign(parameter, this.queryParam) //  无分页
+        const params = Object.assign(parameter, this.queryParam)
         delete params.time
+        // 获取列表数据  有分页
         return salesReportReturnRebateList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(params)
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -191,14 +195,14 @@ export default {
           return data
         })
       },
-      productType: [],
-      totalData: null,
-      columns: [],
-      countLabel: [],
-      countBrandLabel: []
+      totalData: null, // 统计数据
+      columns: [], // 列
+      countLabel: [], // 统计分类数据
+      countBrandLabel: []// 统计品牌数据
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -240,6 +244,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -251,7 +256,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  退货日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -261,9 +266,11 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 客户名称 change
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
+    // 所在区域 change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -295,6 +302,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 地区 change
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
@@ -322,6 +330,7 @@ export default {
       })
       this.resetSearchForm()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 44 - 30
src/views/reportData/salesReturnsReport/list.vue

@@ -14,7 +14,7 @@
           <a-row :gutter="15">
             <a-col :md="7" :sm="24">
               <a-form-model-item label="退货完成日期" prop="time">
-                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+                <rangeDate ref="rangeDate" id="salesReturnsReportList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -53,7 +53,7 @@
                 <a-form-model-item label="退货类型">
                   <v-select
                     v-model="queryParam.salesReturnType"
-                    id="departUser-salesReturnType"
+                    id="salesReturnsReportList-salesReturnType"
                     code="SALES_RETURN_TYPE"
                     placeholder="请选择退货类型"
                     allowClear></v-select>
@@ -61,7 +61,7 @@
               </a-col>
               <a-col :md="7" :sm="24">
                 <a-form-model-item label="退货仓库">
-                  <chooseWarehouse ref="warehouse" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
+                  <chooseWarehouse id="salesReturnsReportList-warehouse" ref="warehouse" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
                 </a-form-model-item>
               </a-col>
               <a-col :md="7" :sm="24">
@@ -69,16 +69,16 @@
                   <v-select
                     v-model="queryParam.goodFlag"
                     ref="goodFlag"
-                    id="returnSchedule-goodFlag"
+                    id="salesReturnsReportList-goodFlag"
                     code="GOOD_FLAG"
                     placeholder="请选择退货类别"
                     allowClear></v-select>
                 </a-form-model-item>
               </a-col>
               <a-col :md="5" :sm="24" v-show="isShowCustomerSearch">
-                <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-                </a-form-item>
+                <a-form-model-item label="客服">
+                  <customerService id="salesReturnsReportList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -115,6 +115,7 @@
           <span>显示:</span>
           <a-tree-select
             size="small"
+            id="salesReturnsReportList-isShowColumn"
             v-model="showCols"
             style="min-width: 200px"
             dropdownMatchSelectWidth
@@ -134,7 +135,7 @@
           :data="loadData"
           :pageSize="30"
           :style="{ height: tableHeight+70+'px' }"
-          :scroll="{ x: 1740, y: tableHeight - 30 }"
+          :scroll="{ x: 1740, y: tableHeight - 40 }"
           :defaultLoadData="false"
           bordered>
           <template slot="footer">
@@ -158,15 +159,17 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
-import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import reportModal from '@/views/common/reportModal.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import customerService from '@/views/common/customerService'
 import AreaList from '@/views/common/areaList.js'
-import { hdExportExcel } from '@/libs/exportExcel'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+// 接口
 import { reportSalesReturnList, reportSalesReturnCount, salesReturnsExport } from '@/api/reportData'
 export default {
   name: 'SalesReturnsReportList',
@@ -175,46 +178,51 @@ export default {
   data () {
     return {
       spinning: false,
-      exportLoading: false,
+      exportLoading: false, // 导出按钮加载状态
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      //  查询条件
+      queryParam: {
+        // 退货完成日期  默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        salesReturnBillNo: '',
-        goodFlag: undefined,
-        salesReturnType: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
+        salesReturnBillNo: '', // 退货单号
+        goodFlag: undefined, // 退货类别
+        salesReturnType: undefined, // 退货类型
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined// 分区
         },
-        warehouseSn: undefined,
-        dealerSn: '',
-        dealerProvinceSn: undefined,
-        dealerCitySn: undefined,
-        dealerCountySn: undefined,
+        warehouseSn: undefined, // 出库仓库
+        dealerSn: '', // 客户sn
+        dealerProvinceSn: undefined, // 省
+        dealerCitySn: undefined, // 市
+        dealerCountySn: undefined, // 区
         bizUserSn: undefined// 客服
       },
       rules: {
         'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
+        // 获取列表数据  有分页
         return reportSalesReturnList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(params)
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -225,7 +233,7 @@ export default {
           return data
         })
       },
-      totalData: null,
+      totalData: null, // 统计数据
       colsArr: [
         {
           title: '直接差价金额(明细)',
@@ -240,7 +248,7 @@ export default {
           disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice')
         }
       ],
-      showCols: []
+      showCols: []// 已选择显示的列
     }
   },
   computed: {
@@ -298,6 +306,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -343,6 +352,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -364,9 +374,11 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 客户名称 change
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
+    // 区域分区 change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -401,14 +413,16 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 地区
     areaChange (val) {
       this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
       this.queryParam.dealerCitySn = val[1] ? val[1] : ''
       this.queryParam.dealerCountySn = val[2] ? val[2] : ''
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 200
+      this.tableHeight = window.innerHeight - tableSearchH - 232
     }
   },
   mounted () {

+ 47 - 34
src/views/reportData/salesSlipReport/list.vue

@@ -14,7 +14,7 @@
           <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 ref="rangeDate" id="salesSlipReportList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -27,7 +27,7 @@
                 <v-select
                   v-model="queryParam.dealerLevel"
                   ref="dealerLevel"
-                  id="salesSlipReportList-allocateTypeSn"
+                  id="salesSlipReportList-dealerLevel"
                   code="DEALER_LEVEL"
                   placeholder="请选择客户级别"
                   allowClear></v-select>
@@ -35,23 +35,23 @@
             </a-col>
             <a-col :md="6" :sm="24" v-if="isShowCustomerSearch">
               <a-form-model-item label="销售单号">
-                <a-input id="salesSlipReportList-allocateTypeSn" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                <a-input id="salesSlipReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24" v-if="!isShowCustomerSearch">
                 <a-form-model-item label="销售单号">
-                  <a-input id="salesSlipReportList-allocateTypeSn" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+                  <a-input id="salesSlipReportList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="所在区域">
-                  <subarea id="salesSlipReportList-allocateTypeSn" ref="subarea" @change="subareaChange"></subarea>
+                  <subarea id="salesSlipReportList-subareaSn" ref="subarea" @change="subareaChange"></subarea>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="salesSlipReportList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -60,9 +60,9 @@
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
-                <a-form-item label="客服">
-                  <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
-                </a-form-item>
+                <a-form-model-item label="客服">
+                  <customerService id="salesSlipReportList-customerName" ref="customerName" v-model="queryParam.bizUserSn"></customerService>
+                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="isShowCustomerSearch?24:6" :sm="24" style="margin-bottom: 10px;" :style="{textAlign: isShowCustomerSearch?'center':''}">
@@ -133,17 +133,19 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
 import AreaList from '@/views/common/areaList.js'
 import BizUser from '@/views/common/bizUser.js'
 import customerService from '@/views/common/customerService'
-import { hdExportExcel } from '@/libs/exportExcel'
-import { salesKdxxdReportTitle, salesBillReportList, salesBillReportCount } from '@/api/salesBillReport'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+// 接口
 import { salesSlipExport } from '@/api/reportData'
+import { salesKdxxdReportTitle, salesBillReportList, salesBillReportCount } from '@/api/salesBillReport'
 export default {
   name: 'SalesSlipReportList',
   mixins: [commonMixin],
@@ -152,46 +154,52 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        // 默认下推时间
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         salesBillNo: '', //  销售单号
-        dealerSn: undefined,
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
+        dealerSn: undefined, // 客户sn
+        dealerLevel: undefined, // 客户等级
+        provinceSn: undefined, // 省
+        citySn: undefined, // 市
+        districtSn: undefined, // 区
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
-          bizUserSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
+          bizUserSn: undefined// 区域负责人
         },
-        dealerLevel: undefined,
         bizUserSn: undefined// 客服
       },
-      columns: [],
-      countLabel: [],
-      countBrandLabel: [],
+      columns: [], // 表格列
+      countLabel: [], // 统计品牌数据
+      countBrandLabel: [], // 统计分类数据
+      totalData: null, // 统计
       rules: {
         'time': [{ required: true, message: '请选择下推时间', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize })
+        // 获取列表数据  有分页
         return salesBillReportList(paramsPage).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 获取统计数据
             this.getCount(paramsPage)
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -201,11 +209,11 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      totalData: null
+      }
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -247,6 +255,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -258,7 +267,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  下推时间  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -268,9 +277,11 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 客户名称  change
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
+    // 区域分区  change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -303,6 +314,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 地区
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
@@ -330,6 +342,7 @@ export default {
       })
       this.resetSearchForm()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 56 - 38
src/views/reportData/tireSalesReport/detailList.vue

@@ -1,10 +1,10 @@
 <template>
   <div>
-    <a-card size="small" :bordered="false" class="tireSalesDealerList-wrap searchBoxNormal">
+    <a-card size="small" :bordered="false" class="tireSalesReportList-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper" ref="tableSearch">
         <a-form-model
-          id="tireSalesDealerList-form"
+          id="tireSalesReportList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -13,22 +13,28 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="日期" prop="time">
-                <rangeDate ref="rangeDate" :showTime="false" :today="false" :value="queryParam.time" @change="dateChange" />
+                <rangeDate
+                  ref="rangeDate"
+                  id="tireSalesReportList-time"
+                  :showTime="false"
+                  :today="false"
+                  :value="queryParam.time"
+                  @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="地区">
-                <AreaList id="tireSalesDealerList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                <AreaList id="tireSalesReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="区域/分区">
-                <subarea id="tireSalesDealerList-subarea" ref="subarea" @change="subareaChange"></subarea>
+                <subarea id="tireSalesReportList-subarea" ref="subarea" @change="subareaChange"></subarea>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="客户名称">
-                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="tireSalesDealerList-dealerName" @change="custChange" />
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="tireSalesReportList-dealerName" @change="custChange" />
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
@@ -37,7 +43,7 @@
                   <v-select
                     v-model="queryParam.dealerLevel"
                     ref="dealerLevel"
-                    id="tireSalesDealerList-dealerLevel"
+                    id="tireSalesReportList-dealerLevel"
                     code="DEALER_LEVEL"
                     placeholder="请选择客户级别"
                     allowClear></v-select>
@@ -45,17 +51,17 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="tireSalesReportList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品编码/原厂编码">
-                  <a-input id="tireSalesDealerList-productWord" v-model.trim="queryParam.productWord" allowClear placeholder="请输入产品编码/原厂编码"/>
+                  <a-input id="tireSalesReportList-productWord" v-model.trim="queryParam.productWord" allowClear placeholder="请输入产品编码/原厂编码"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品名称">
-                  <a-input id="tireSalesDealerList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                  <a-input id="tireSalesReportList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -65,12 +71,12 @@
                 type="primary"
                 @click="handleSearch"
                 :disabled="disabled"
-                id="tireSalesDealerList-refresh">查询</a-button>
+                id="tireSalesReportList-refresh">查询</a-button>
               <a-button
                 style="margin-left: 8px"
                 @click="resetSearchForm"
                 :disabled="disabled"
-                id="tireSalesDealerList-reset">重置</a-button>
+                id="tireSalesReportList-reset">重置</a-button>
               <a-button
                 style="margin-left: 10px"
                 type="primary"
@@ -79,7 +85,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 v-if="$hasPermissions('B_tireReportExport')"
-                id="tireSalesDealerList-export">导出</a-button>
+                id="tireSalesReportList-export">导出</a-button>
               <a-button
                 style="margin-left: 10px"
                 type="primary"
@@ -88,7 +94,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 v-if="$hasPermissions('B_tireDetailExport')"
-                id="tireSalesDealerList-export">导出出库明细</a-button>
+                id="tireSalesReportList-exportDetail">导出出库明细</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'" />
@@ -124,7 +130,7 @@
               type="link"
               class="button-warning"
               @click="handleOutDetail(record)"
-              id="transferReturnConfirmation-audit-btn">出库明细</a-button>
+              id="tireSalesReportList-outDetail">出库明细</a-button>
             <span v-else>--</span>
           </template>
           <template slot="footer">
@@ -162,6 +168,8 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
@@ -169,11 +177,11 @@ import AreaList from '@/views/common/areaList.js'
 import BizUser from '@/views/common/bizUser.js'
 import reportModal from '@/views/common/reportModal.vue'
 import outDetailModal from './outDetailModal'
-import { hdExportExcel } from '@/libs/exportExcel'
-import { queryTireDetailCount, tireListExport, tireReportDetailList, tireOutDetailListExport } from '@/api/reportData'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+// 接口
+import { queryTireDetailCount, tireListExport, tireReportDetailList, tireOutDetailListExport } from '@/api/reportData'
 export default {
-  name: 'TireSalesDealerList',
+  name: 'TireSalesReportList',
   mixins: [commonMixin],
   components: { STable, VSelect, outDetailModal, rangeDate, subarea, AreaList, BizUser, dealerSubareaScopeList, reportModal },
   data () {
@@ -181,27 +189,30 @@ export default {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      queryParam: { //  查询条件
-        time: [],
-        bizBeginDate: '',
-        bizEndDate: '',
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
-        dealerLevel: undefined,
-        dealerName: undefined,
-        dealerSn: undefined,
-        subareaArea: {// 区域分区
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
+      tableHeight: 0, // 表格高度
+      exportLoading: false, // 导出按钮加载状态
+      showExport: false, // 导出弹窗
+      //  查询条件
+      queryParam: {
+        time: [], // 日期
+        bizBeginDate: '', // 开始时间
+        bizEndDate: '', // 结束时间
+        provinceSn: undefined, // 省
+        citySn: undefined, // 市
+        districtSn: undefined, // 区
+        dealerLevel: undefined, // 客户等级
+        dealerName: undefined, // 客户名称
+        dealerSn: undefined, // 客户sn
+        subareaArea: {
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
           bizUserSn: undefined // 区域负责人
         },
         productWord: '', // 产品编码/原厂编码
         productName: '' // 产品名称
       },
-      exportLoading: false,
-      showExport: false,
+      totalData: null, // 合计
+      showOutDetail: false, // 出库明细弹窗
       rules: {
         'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
       },
@@ -212,23 +223,24 @@ export default {
         const oldParams = Object.assign(parameter, this.queryParam)
         const params = JSON.parse(JSON.stringify(oldParams))
         delete params.time
+        // 获取列表数据  有分页
         return tireReportDetailList(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
             }
             this.disabled = false
+            // 获取统计数据
             this.getCount(params)
           }
           this.spinning = false
           return data
         })
-      },
-      totalData: null,
-      showOutDetail: false
+      }
     }
   },
   watch: {
@@ -296,6 +308,7 @@ export default {
         }
       })
     },
+    // 客户名称 change
     custChange (val) {
       this.queryParam.dealerName = val.name
       this.queryParam.dealerSn = val.key
@@ -343,6 +356,7 @@ export default {
       this.queryParam.bizBeginDate = date[0] ? date[0].replace(/-/g, '') : ''
       this.queryParam.bizEndDate = date[1] ? date[1].replace(/-/g, '') : ''
     },
+    // 区域分区  change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -371,7 +385,7 @@ export default {
       this.$refs.table.clearTable()
       this.$refs.ruleForm.resetFields()
     },
-    //  导出
+    //  导出  必填判断
     handleExport (pos) {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -387,6 +401,7 @@ export default {
         }
       })
     },
+    // 轮胎明细报表导出
     exportList () {
       const _this = this
       const params = JSON.parse(JSON.stringify(_this.queryParam))
@@ -402,6 +417,7 @@ export default {
         _this.$store.state.app.curActionPermission = ''
       })
     },
+    // 轮胎出库明细报表  导出
     exportOutDetailList () {
       const _this = this
       const params = JSON.parse(JSON.stringify(_this.queryParam))
@@ -416,11 +432,13 @@ export default {
         _this.$store.state.app.curActionPermission = ''
       })
     },
+    // 初始化
     pageInit () {
       this.$nextTick(() => { // 页面渲染完成后的回调
         this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 280

+ 4 - 2
src/views/reportData/tireSalesReport/index.vue

@@ -3,7 +3,6 @@
     <a-card size="small" :bordered="false">
       <a-tabs default-active-key="1" @change="handleChange">
         <a-tab-pane key="1" tab="轮胎统计报表">
-          <!-- 列表 -->
           <tireList ref="tireStatisticsList"></tireList>
         </a-tab-pane>
         <a-tab-pane key="2" tab="轮胎明细报表" force-render>
@@ -15,6 +14,7 @@
 </template>
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import tireList from './list'
 import detailList from './detailList'
 export default {
@@ -23,13 +23,15 @@ export default {
   components: { tireList, detailList },
   data () {
     return {
-      tabVal: 1
+      tabVal: 1 // tab值  1轮胎统计报表 2 轮胎明细报表
     }
   },
   methods: {
+    // 切换tab值  change
     handleChange (val) {
       this.tabVal = val
     },
+    // 初始化
     pageInit () {
       if (this.tabVal == 1) {
         this.$refs.tireStatisticsList.pageInit()

+ 39 - 22
src/views/reportData/tireSalesReport/list.vue

@@ -13,7 +13,13 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="日期" prop="time">
-                <rangeDate ref="rangeDate" :showTime="false" :today="false" :value="queryParam.time" @change="dateChange" />
+                <rangeDate
+                  ref="rangeDate"
+                  :showTime="false"
+                  :today="false"
+                  :value="queryParam.time"
+                  id="tireSalesDealerList-time"
+                  @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -45,7 +51,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser id="tireSalesDealerList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -130,15 +136,17 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
 import BizUser from '@/views/common/bizUser.js'
 import reportModal from '@/views/common/reportModal.vue'
-import { hdExportExcel } from '@/libs/exportExcel'
-import { tireReportList, queryTireCount, tireListExport } from '@/api/reportData'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+// 接口
+import { tireReportList, queryTireCount, tireListExport } from '@/api/reportData'
 export default {
   name: 'TireSalesDealerList',
   mixins: [commonMixin],
@@ -147,26 +155,27 @@ export default {
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      queryParam: { //  查询条件
-        time: [],
-        bizBeginDate: '',
-        bizEndDate: '',
-        provinceSn: undefined,
-        citySn: undefined,
-        districtSn: undefined,
-        dealerLevel: undefined,
-        dealerName: undefined,
-        dealerSn: undefined,
-        subareaArea: {// 区域分区
-          subareaSn: undefined,
-          subareaAreaSn: undefined,
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      showExport: false, // 导出弹窗
+      tableHeight: 0, // 表格高度
+      //  查询条件
+      queryParam: {
+        time: [], // 日期
+        bizBeginDate: '', // 开始时间
+        bizEndDate: '', // 结束时间
+        provinceSn: undefined, // 省份编码
+        citySn: undefined, // 市编码
+        districtSn: undefined, // 区编码
+        dealerLevel: undefined, // 客户等级
+        dealerName: undefined, // 客户名称
+        dealerSn: undefined, // 客户sn
+        subareaArea: {
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined, // 分区
           bizUserSn: undefined // 区域负责人
         }
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      showExport: false,
       rules: {
         'time': [{ required: true, message: '请选择日期', trigger: 'change' }]
       },
@@ -177,15 +186,18 @@ export default {
         const oldParams = Object.assign(parameter, this.queryParam)
         const params = JSON.parse(JSON.stringify(oldParams))
         delete params.time
+        // 获取列表数据  有分页
         return tireReportList(params).then(res => {
           let data
           if (res.status == 200 && res.data) {
             data = res.data
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
             }
             this.disabled = false
+            // 获取统计数据
             this.getCount(params)
           }
           this.spinning = false
@@ -196,6 +208,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -267,6 +280,7 @@ export default {
         }
       })
     },
+    // 客户名称 change
     custChange (val) {
       this.queryParam.dealerName = val.name
       this.queryParam.dealerSn = val.key
@@ -297,6 +311,7 @@ export default {
       this.queryParam.bizBeginDate = date[0] ? date[0].replace(/-/g, '') : ''
       this.queryParam.bizEndDate = date[1] ? date[1].replace(/-/g, '') : ''
     },
+    // 区域分区  change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -325,7 +340,7 @@ export default {
       this.$refs.subarea.clearData()
       this.$refs.table.clearTable()
     },
-    //  导出
+    //  导出 查询数据必填判断
     handleExport () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -353,12 +368,14 @@ export default {
         _this.$store.state.app.curActionPermission = ''
       })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 276

+ 60 - 54
src/views/reportData/transferReturnDetailReport/list.vue

@@ -1,10 +1,10 @@
 <template>
   <div>
-    <a-card size="small" :bordered="false" class="allocateReturnDetailReport-wrap searchBoxNormal">
+    <a-card size="small" :bordered="false" class="transferReturnDetailReport-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper" ref="tableSearch">
         <a-form-model
-          id="salesSlipReportList-form"
+          id="transferReturnDetailReport-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -14,74 +14,74 @@
           <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 ref="rangeDate" id="transferReturnDetailReport-time" :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="allocateReturnDetailReport-allocateReturnNo" v-model.trim="queryParam.allocateReturnNo" allowClear placeholder="请输入调拨退货单号"/>
+                <a-input id="transferReturnDetailReport-allocateReturnNo" v-model.trim="queryParam.allocateReturnNo" allowClear placeholder="请输入调拨退货单号"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨退货对象名称">
-                <a-input id="allocateReturnDetailReport-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调拨退货对象名称"/>
-              </a-form-item>
+              <a-form-model-item label="调拨退货对象名称">
+                <a-input id="transferReturnDetailReport-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调拨退货对象名称"/>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨退货类型">
-                <AllocateType id="allocateReturnDetailReport-allocateReturnTypeSn" :changeOnSelect="true" v-model="allocateTypeVal" @change="changeAllocatype"></AllocateType>
-              </a-form-item>
+              <a-form-model-item label="调拨退货类型">
+                <AllocateType id="transferReturnDetailReport-allocateReturnTypeSn" :changeOnSelect="true" v-model="allocateTypeVal" @change="changeAllocatype"></AllocateType>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨退货对象类型">
+              <a-form-model-item label="调拨退货对象类型">
                 <v-select
                   code="TARGET_TYPE"
-                  id="allocateReturnDetailReport-argetType"
+                  id="transferReturnDetailReport-targetType"
                   v-model="queryParam.targetType"
                   allowClear
                   placeholder="请选择调拨退货对象类型"></v-select>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="所在区域">
-                <subarea id="allocateReturnDetailReport-subareaSn" ref="subarea" @change="subareaChange"></subarea>
+                <subarea id="transferReturnDetailReport-subareaSn" ref="subarea" @change="subareaChange"></subarea>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="所在省份">
-                <Area id="allocateReturnDetailReport-provinceSn" defValKey="id" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
+                <Area id="transferReturnDetailReport-provinceSn" defValKey="id" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="产品品牌">
-                <ProductBrand id="allocateReturnDetailReport-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                <ProductBrand id="transferReturnDetailReport-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="品牌分类">
-                  <v-select code="BRAND_TYPE" id="allocateReturnDetailReport-productBrandTypeSn" v-model="queryParam.productBrandTypeSn" allowClear placeholder="请选择品牌分类"></v-select>
+                  <v-select code="BRAND_TYPE" id="transferReturnDetailReport-productBrandTypeSn" v-model="queryParam.productBrandTypeSn" allowClear placeholder="请选择品牌分类"></v-select>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品分类">
-                  <ProductType id="allocateReturnDetailReport-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+                  <ProductType id="transferReturnDetailReport-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品名称">
-                  <a-input id="allocateReturnDetailReport-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                  <a-input id="transferReturnDetailReport-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品编码">
-                  <a-input id="allocateReturnDetailReport-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+                  <a-input id="transferReturnDetailReport-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
                 </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align:center;">
-              <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="allocateReturnDetailReport-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="allocateReturnDetailReport-reset">重置</a-button>
+              <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="transferReturnDetailReport-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="transferReturnDetailReport-reset">重置</a-button>
               <a-button
                 style="margin-left: 10px"
                 type="primary"
@@ -90,7 +90,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 v-if="$hasPermissions('M_transferReturnDetailReportExport')"
-                id="allocateReturnDetailReport-export">导出</a-button>
+                id="transferReturnDetailReport-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -144,6 +144,8 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
@@ -152,7 +154,7 @@ import AllocateType from '@/views/common/allocateType.js'
 import Area from '@/views/common/area.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductType from '@/views/common/productType.js'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { allocateReturnReportDetailQueryPage, allocateReturnReportDetailQueryCount, allocateReturnReportDetailExport } from '@/api/reportData'
 export default {
   name: 'TransferReturnDetailReportList',
@@ -162,40 +164,41 @@ export default {
     return {
       spinning: false,
       advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        // 退货完成日期 默认日期
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        allocateReturnNo: '',
-        productCode: '',
-        productName: '',
-        targetName: '',
-        costTypeSn: undefined,
-        allocateSortSn: undefined,
-        allocateReturnTypeSn: undefined,
-        targetType: undefined,
-        productBrandTypeSn: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
+        allocateReturnNo: '', // 调拨退货单号
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        targetName: '', // 调拨退货对象名称
+        costTypeSn: undefined, // 调拨退货  成本类型
+        allocateSortSn: undefined, // 调拨退货类型
+        allocateReturnTypeSn: undefined, // 调拨退货类型 sn
+        targetType: undefined, // 调拨退货对象类型
+        productBrandTypeSn: undefined, // 品牌分类
         productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined// 分区
         },
-        provinceSn: undefined
+        provinceSn: undefined// 省份编码
       },
-      productType: [],
       rules: {
         'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -216,11 +219,14 @@ export default {
           }
         })
         delete params.time
+        // 获取列表数据 有分页
         return allocateReturnReportDetailQueryPage(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(params)
+            // 计算列表序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -231,8 +237,9 @@ export default {
           return data
         })
       },
-      totalData: null,
-      allocateTypeVal: []
+      totalData: null, // 统计数据
+      productType: [], // 产品分类
+      allocateTypeVal: []// 调拨退货类型数据
     }
   },
   computed: {
@@ -269,6 +276,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -280,16 +288,13 @@ export default {
     }
   },
   methods: {
+    // 调拨退货类型 change
     changeAllocatype (val, opts) {
       this.allocateTypeVal = val || []
       this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
       this.queryParam.allocateSortSn = val && val[1] ? val[1] : ''
       this.queryParam.allocateReturnTypeSn = val && val[2] ? val[2] : ''
     },
-    // 盘点库存日期
-    handleStock () {
-      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
-    },
     // 总计
     getCount (params) {
       allocateReturnReportDetailQueryCount(params).then(res => {
@@ -300,6 +305,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -311,7 +317,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  退货完成日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -321,9 +327,7 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
-    custChange (val) {
-      this.queryParam.dealerSn = val.key
-    },
+    // 区域 change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -391,6 +395,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => {
@@ -398,6 +403,7 @@ export default {
       })
       _this.resetSearchForm()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200

+ 47 - 38
src/views/reportData/transferReturnReport/list.vue

@@ -1,10 +1,10 @@
 <template>
   <div>
-    <a-card size="small" :bordered="false" class="allocateReturnReport-wrap searchBoxNormal">
+    <a-card size="small" :bordered="false" class="transferReturnReportList-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper" ref="tableSearch">
         <a-form-model
-          id="allocateReturnReport-form"
+          id="transferReturnReportList-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -14,34 +14,34 @@
           <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 ref="rangeDate" id="transferReturnReportList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨退货单号">
+              <a-form-model-item label="调拨退货单号">
                 <a-input id="transferReturnReportList-allocateReturnNo" v-model.trim="queryParam.allocateReturnNo" allowClear placeholder="请输入调拨退货单号"/>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨退货对象名称">
+              <a-form-model-item label="调拨退货对象名称">
                 <a-input id="transferReturnReportList-targetName" v-model.trim="queryParam.targetName" allowClear placeholder="请输入调拨退货对象名称"/>
-              </a-form-item>
+              </a-form-model-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
-                <a-form-item label="调拨退货类型">
+                <a-form-model-item label="调拨退货类型">
                   <AllocateType id="transferReturnReportList-allocateReturnTypeSn" :changeOnSelect="true" v-model="allocateTypeVal" @change="changeAllocatype"></AllocateType>
-                </a-form-item>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="调拨退货对象类型">
+                <a-form-model-item label="调拨退货对象类型">
                   <v-select
                     code="TARGET_TYPE"
-                    id="transferReturnReportList-argetType"
+                    id="transferReturnReportList-targetType"
                     v-model="queryParam.targetType"
                     allowClear
                     placeholder="请选择调拨退货对象类型"></v-select>
-                </a-form-item>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="所在区域">
@@ -50,8 +50,8 @@
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="allocateReturnReport-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="allocateReturnReport-reset">重置</a-button>
+              <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="transferReturnReportList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="transferReturnReportList-reset">重置</a-button>
               <a-button
                 style="margin-left: 5px"
                 type="primary"
@@ -60,7 +60,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 v-if="$hasPermissions('M_transferReturnReportExport')"
-                id="allocateReturnReport-export">导出</a-button>
+                id="transferReturnReportList-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -114,12 +114,14 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import reportModal from '@/views/common/reportModal.vue'
 import AllocateType from '@/views/common/allocateType.js'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { allocateReturnReportQueryPage, allocateReturnReportQueryCount, allocateReturnReportExport } from '@/api/reportData'
 export default {
   name: 'TransferReturnReportList',
@@ -128,43 +130,48 @@ export default {
   data () {
     return {
       spinning: false,
-      exportLoading: false,
+      exportLoading: false, // 导出按钮加载状态
       advanced: true, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      //  查询条件
+      queryParam: {
+        // 退货完成日期 默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        allocateReturnNo: '',
-        targetName: '',
-        costTypeSn: undefined,
-        allocateSortSn: undefined,
-        allocateReturnTypeSn: undefined,
-        targetType: undefined,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
+        allocateReturnNo: '', // 退货单号
+        targetName: '', // 调拨退货对象名称
+        costTypeSn: undefined, // 调拨退货  成本类型
+        allocateSortSn: undefined, // 调拨退货类型
+        allocateReturnTypeSn: undefined, // 调拨退货类型 sn
+        targetType: undefined, // 调拨退货对象类型
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined// 分区
         }
       },
       rules: {
         'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
+        // 获取列表数据 有分页
         return allocateReturnReportQueryPage(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(params)
+            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -175,8 +182,8 @@ export default {
           return data
         })
       },
-      totalData: null,
-      allocateTypeVal: []
+      totalData: null, // 统计数据
+      allocateTypeVal: []// 调拨退货类型数据
     }
   },
   computed: {
@@ -205,6 +212,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -216,6 +224,7 @@ export default {
     }
   },
   methods: {
+    // 调拨退货类型
     changeAllocatype (val, opts) {
       this.allocateTypeVal = val || []
       this.queryParam.costTypeSn = val && val[0] ? val[0] : ''
@@ -242,10 +251,6 @@ export default {
         }
       })
     },
-    // 盘点库存日期
-    handleStock () {
-      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
-    },
     // 总计
     getCount (params) {
       allocateReturnReportQueryCount(params).then(res => {
@@ -256,6 +261,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -267,7 +273,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  退货完成日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -277,6 +283,7 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
+    // 区域分区 change
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
@@ -306,6 +313,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => {
@@ -313,6 +321,7 @@ export default {
       })
       _this.resetSearchForm()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 42 - 29
src/views/reportData/urchaseDetailReturn/detailList.vue

@@ -4,7 +4,7 @@
       <!-- 搜索条件 -->
       <div class="table-page-search-wrapper" ref="tableSearch">
         <a-form-model
-          id="salesSlipReportList-form"
+          id="urchaseDetailReturn-form"
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
@@ -14,23 +14,24 @@
           <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 ref="rangeDate" id="urchaseDetailReturn-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="采购退货单号">
-                <a-input v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入采购退货单号"/>
+                <a-input id="urchaseDetailReturn-sparePartsReturnNo" v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入采购退货单号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="供应商名称">
-                <supplier isPermission v-model="queryParam.supplier.supplierSn" @change="getSupplierName" placeholder="请输入供应商名称"></supplier>
+                <supplier id="urchaseDetailReturn-supplierSn" isPermission v-model="queryParam.supplier.supplierSn" @change="getSupplierName" placeholder="请输入供应商名称"></supplier>
               </a-form-model-item>
             </a-col>
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="退货原因">
                   <v-select
+                    id="urchaseDetailReturn-returnReason"
                     v-model="queryParam.returnReason"
                     ref="returnReason"
                     code="SPARE_PARTS_RETURN_REASON"
@@ -60,18 +61,18 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="出库仓库">
-                  <chooseWarehouse isPermission ref="warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
+                  <chooseWarehouse isPermission id="urchaseDetailReturn-warehouse" ref="warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
-                  <AreaList id="salesSlipReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                  <AreaList id="urchaseDetailReturn-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
                 </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-              <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="salesReturnDetailList-refresh">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="salesReturnDetailList-reset">重置</a-button>
+              <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="urchaseDetailReturn-refresh">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="urchaseDetailReturn-reset">重置</a-button>
               <a-button
                 style="margin-left: 10px"
                 type="primary"
@@ -80,7 +81,7 @@
                 :disabled="disabled"
                 :loading="exportLoading"
                 v-if="$hasPermissions('B_urchaseDetailReturn_export')"
-                id="salesReturnDetailList-export">导出</a-button>
+                id="urchaseDetailReturn-export">导出</a-button>
               <a @click="advanced=!advanced" style="margin-left: 5px">
                 {{ advanced ? '收起' : '展开' }}
                 <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -108,6 +109,7 @@
           <template slot="attachmentList" slot-scope="text, record">
             <span v-if="record.attachmentList && record.attachmentList.length > 0">
               <a
+                id="urchaseDetailReturn-link"
                 target="_blank"
                 style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
                 :href="item.filePath"
@@ -137,6 +139,8 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import supplier from '@/views/common/supplier.js'
@@ -144,7 +148,7 @@ import reportModal from '@/views/common/reportModal.vue'
 import AreaList from '@/views/common/areaList.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
-import { hdExportExcel } from '@/libs/exportExcel'
+// 接口
 import { sparePartsReturnDetailReportList, sparePartsReturnDetailReportStat, sparePartsReturnReportExportDetail } from '@/api/reportData'
 export default {
   name: 'UrchaseDetailReturnList',
@@ -154,47 +158,51 @@ export default {
     return {
       spinning: false,
       advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        // 退货完成日期 默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
         sparePartsReturnNo: '', // 采购退货单号
-        returnReason: '',
-        warehouseSn: undefined,
+        returnReason: '', // 退货原因
+        warehouseSn: undefined, // 出库仓库
         product: {
-          name: '',
-          code: '',
-          brandType: undefined,
-          productBrandSn: undefined
+          name: '', // 产品名称
+          code: '', // 产品编码
+          brandType: undefined, // 品牌分类
+          productBrandSn: undefined// 产品品牌 sn
         },
         supplier: {
-          supplierSn: '',
-          supplierName: '',
-          provinceSn: undefined,
-          citySn: undefined,
-          districtSn: undefined
+          supplierSn: '', // 供应商sn
+          supplierName: '', // 供应商名称
+          provinceSn: undefined, // 省
+          citySn: undefined, // 市
+          districtSn: undefined// 区
         }
       },
       rules: {
         'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
+        // 获取列表数据 有分页
         return sparePartsReturnDetailReportList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(params)
             this.disabled = false
           }
@@ -239,6 +247,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -260,10 +269,12 @@ export default {
         }
       })
     },
+    // 供应商 change
     getSupplierName (val, item) {
       this.queryParam.supplier.supplierName = item.supplierName
       this.queryParam.supplier.supplierSn = val
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -278,7 +289,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  退货完成日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -336,11 +347,13 @@ export default {
         }
       })
     },
+    // 地区
     areaChange (val) {
       this.queryParam.supplier.provinceSn = val[0] ? val[0] : ''
       this.queryParam.supplier.citySn = val[1] ? val[1] : ''
       this.queryParam.supplier.districtSn = val[2] ? val[2] : ''
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 27 - 18
src/views/reportData/urchaseReturn/list.vue

@@ -14,22 +14,22 @@
           <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 ref="rangeDate" id="urchaseReturn-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="采购退货单号">
-                <a-input id="urchaseReturnList-productCode" v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入采购退货单号"/>
+                <a-input id="urchaseReturnList-sparePartsReturnNo" v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入采购退货单号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="供应商名称">
-                <supplier v-model="queryParam.supplierSn" isPermission placeholder="请输入供应商名称"></supplier>
+                <supplier id="urchaseReturnList-supplierSn" v-model="queryParam.supplierSn" isPermission placeholder="请输入供应商名称"></supplier>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="退货仓库">
-                <chooseWarehouse isPermission ref="warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
+                <chooseWarehouse id="urchaseReturnList-warehouse" isPermission ref="warehouse" v-model="queryParam.warehouseSn"></chooseWarehouse>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -37,7 +37,7 @@
                 <v-select
                   v-model="queryParam.returnReason"
                   ref="returnReason"
-                  id="purchaseReturn-returnReason"
+                  id="urchaseReturnList-returnReason"
                   code="SPARE_PARTS_RETURN_REASON"
                   placeholder="请选择退货原因"
                   allowClear></v-select>
@@ -79,6 +79,7 @@
             <span v-if="record.attachmentList && record.attachmentList.length > 0">
               <a
                 target="_blank"
+                id="urchaseReturnList-link"
                 style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
                 :href="item.filePath"
                 v-for="item in record.attachmentList"
@@ -106,12 +107,14 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import supplier from '@/views/common/supplier.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import reportModal from '@/views/common/reportModal.vue'
+// 接口
 import { sparePartsReturnReportList, sparePartsReturnReportStat, sparePartsReturnReportExport } from '@/api/reportData'
 export default {
   name: 'UrchaseReturn',
@@ -120,35 +123,39 @@ export default {
   data () {
     return {
       spinning: false,
-      exportLoading: false,
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
+      exportLoading: false, // 导出按钮加载状态
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      //  查询条件
+      queryParam: {
+        // 退货完成日期 默认值
         time: [
           getDate.getCurrMonthDays().starttime,
           getDate.getCurrMonthDays().endtime
         ],
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        sparePartsReturnNo: undefined,
-        supplierSn: undefined,
-        warehouseSn: undefined,
-        returnReason: undefined
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始日期
+        endDate: getDate.getCurrMonthDays().endtime, // 结束日期
+        sparePartsReturnNo: undefined, // 采购退货单号
+        supplierSn: undefined, // 供应商 sn
+        warehouseSn: undefined, // 出库仓库
+        returnReason: undefined// 退货原因
       },
       rules: {
         'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
+        // 获取列表数据 有分页
         return sparePartsReturnReportList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(params)
             this.disabled = false
           }
@@ -156,7 +163,7 @@ export default {
           return data
         })
       },
-      totalData: null
+      totalData: null// 合计
     }
   },
   computed: {
@@ -212,6 +219,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -223,7 +231,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  退货完成日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -250,6 +258,7 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 215

+ 27 - 34
src/views/reportData/warehousingOrder/list.vue

@@ -14,7 +14,7 @@
           <a-row :gutter="15">
             <a-col :md="7" :sm="24">
               <a-form-model-item label="完成日期" prop="time">
-                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange" />
+                <rangeDate ref="rangeDate" id="warehousingOrderList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="5" :sm="24">
@@ -52,17 +52,11 @@
               </a-col>
               <a-col :md="5" :sm="24">
                 <a-form-model-item label="入库仓库">
-                  <chooseWarehouse ref="warehouse" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
+                  <chooseWarehouse id="warehousingOrderList-warehouseSn" ref="warehouse" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
                 </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="7" :sm="24" style="margin-bottom: 10px;">
-              <!-- <a-button
-                type="primary"
-                class="button-info"
-                size="small"
-                @click="handleStock"
-                id="warehousingOrderList-stockDate">盘点区间日期</a-button> -->
               <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="warehousingOrderList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="warehousingOrderList-reset">重置</a-button>
               <a-button
@@ -134,36 +128,41 @@ export default {
   data () {
     return {
       spinning: false,
-      advanced: false,
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
-        stockPutNo: '',
-        supplierName: '',
-        putBizType: undefined,
-        sparePartsType: undefined,
-        warehouseSn: undefined
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      // 查询条件
+      queryParam: {
+        time: [], // 完成日期
+        beginDate: '', // 开始日期
+        endDate: '', // 结束日期
+        stockPutNo: '', // 入库单号
+        supplierName: '', // 单位名称
+        putBizType: undefined, // 入库类型
+        sparePartsType: undefined, // 散件入库子类型
+        warehouseSn: undefined// 出库仓库
       },
       rules: {
         'time': [{ required: true, message: '请选择完成日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
+      totalData: null, // 统计
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
+        // 获取列表数据 有分页
         return reportStockPutList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
+            // 统计
             this.getCount(params)
             const no = (data.pageNo - 1) * data.pageSize
+            // 计算列表序号
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
             }
@@ -172,8 +171,7 @@ export default {
           this.spinning = false
           return data
         })
-      },
-      totalData: null
+      }
     }
   },
   computed: {
@@ -196,6 +194,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭  表格高度变化
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -207,10 +206,6 @@ export default {
     }
   },
   methods: {
-    // 盘点库存日期
-    handleStock () {
-      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
-    },
     // 总计
     getCount (params) {
       reportStockPutCount(params).then(res => {
@@ -221,6 +216,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -232,7 +228,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  完成日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -277,15 +273,12 @@ export default {
         }
       })
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
+    // 初始化
     pageInit () {
       this.setTableH()
       this.resetSearchForm()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200

+ 26 - 33
src/views/reportData/warehousingOrderDetail/list.vue

@@ -14,7 +14,7 @@
           <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 ref="rangeDate" id="warehousingOrderDetailList-time" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -47,7 +47,7 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="入库仓库">
-                  <chooseWarehouse ref="warehouse" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
+                  <chooseWarehouse ref="warehouse" id="warehousingOrderDetailList-warehouseSn" isPermission v-model="queryParam.warehouseSn"></chooseWarehouse>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -67,12 +67,6 @@
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="margin-bottom: 10px;text-align:center;">
-              <!-- <a-button
-                type="primary"
-                class="button-info"
-                size="small"
-                @click="handleStock"
-                id="warehousingOrderDetailList-stockDate">盘点区间日期</a-button> -->
               <a-button style="margin-left: 5px" type="primary" @click="handleSearch" :disabled="disabled" id="warehousingOrderDetailList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="warehousingOrderDetailList-reset">重置</a-button>
               <a-button
@@ -129,11 +123,13 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { hdExportExcel } from '@/libs/exportExcel'
 import reportModal from '@/views/common/reportModal.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
+// 接口
 import { reportStockPutDetailList, reportStockPutDetailCount, reportStockPutDetailExport } from '@/api/reportData'
 export default {
   name: 'WarehousingOrderDetailList',
@@ -143,30 +139,32 @@ export default {
     return {
       spinning: false,
       advanced: false, // 高级搜索 展开/关闭
-      tableHeight: 0,
-      showExport: false,
-      queryParam: { //  查询条件
-        time: [],
-        beginDate: '',
-        endDate: '',
-        stockPutNo: '',
-        putBizType: undefined,
-        supplierName: '',
-        productName: '',
-        productCode: '',
-        warehouseSn: undefined
+      tableHeight: 0, // 表格高度
+      showExport: false, // 导出弹窗
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出按钮加载状态
+      //  查询条件
+      queryParam: {
+        time: [], // 完成日期
+        beginDate: '', // 开始日期
+        endDate: '', // 结束日期
+        stockPutNo: '', // 入库单号
+        putBizType: undefined, // 入库类型
+        supplierName: '', // 单位名称
+        productName: '', // 产品名称
+        productCode: '', // 产品编码
+        warehouseSn: undefined// 入库仓库
       },
       rules: {
         'time': [{ required: true, message: '请选择完成日期', trigger: 'change' }]
       },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
+        // 获取列表数据 有分页
         return reportStockPutDetailList(params).then(res => {
           let data
           if (res.status == 200) {
@@ -211,6 +209,7 @@ export default {
     }
   },
   watch: {
+    // 展开关闭 重新计算表格高度
     advanced (newValue, oldValue) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -222,10 +221,6 @@ export default {
     }
   },
   methods: {
-    // 盘点库存日期
-    handleStock () {
-      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
-    },
     // 总计
     getCount (params) {
       reportStockPutDetailCount(params).then(res => {
@@ -236,6 +231,7 @@ export default {
         }
       })
     },
+    // 查询
     handleSearch () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
@@ -247,7 +243,7 @@ export default {
         }
       })
     },
-    //  创建时间  change
+    //  完成日期  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -293,15 +289,12 @@ export default {
         }
       })
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
+    // 初始化
     pageInit () {
       this.resetSearchForm()
       this.setTableH()
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 200

+ 17 - 9
src/views/salesManagement/matchSendOutOrder/list.vue

@@ -159,7 +159,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
 import rangeDate from '@/views/common/rangeDate.vue'
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import subarea from '@/views/common/subarea.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
@@ -183,12 +185,15 @@ export default {
       detailType: 2,
       bizSn: null,
       tableHeight: 0,
-      time: [],
+      time: [
+        moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ],
       checktime: [],
       // 查询参数
       queryParam: {
-        beginDate: '',
-        endDate: '',
+        beginDate: getDate.getThreeMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         checkBeginDate: '',
         checkEndDate: '',
         buyerSn: undefined, //  客户名称
@@ -247,9 +252,9 @@ export default {
         { title: '对单时间', dataIndex: 'checkDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
-	  if (this.isShowWarehouse) {
-	    arr.splice(7, 0, { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
-	  }
+      if (this.isShowWarehouse) {
+        arr.splice(7, 0, { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
+      }
       if (this.$hasPermissions('M_matchSendOutOrderList_salesPrice')) { //  售价权限
         arr.splice(this.isShowWarehouse ? 10 : 9, 0, { title: '总售价', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
@@ -311,15 +316,18 @@ export default {
     },
     // 重置
     resetSearchForm () {
-      this.time = []
+      this.time = [
+        getDate.getCurrMonthDays().starttime,
+        getDate.getCurrMonthDays().endtime
+      ]
       this.$refs.rangeDate.resetDate(this.time)
       this.checktime = []
       this.$refs.checkDate.resetDate(this.checktime)
       this.$refs.dealerSubareaScopeList.resetForm()
       this.$refs.shbuyerName.resetForm()
       this.queryParam = {
-        beginDate: '',
-        endDate: '',
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         checkBeginDate: '',
         checkEndDate: '',
         buyerSn: undefined, //  客户名称

+ 28 - 26
src/views/salesManagement/pushOrderManagement/detail.vue

@@ -72,29 +72,29 @@
       <div style="padding: 10px 12px 0 12px" v-show="outBizSubSn||bizSn">
         <a-collapse :activeKey="['1']">
           <a-collapse-panel key="1" header="基础信息">
-             <a-descriptions size="small" :column="3">
-               <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
-               <a-descriptions-item label="销售单号">{{ detailData&&detailData.salesBillNo || '--' }}</a-descriptions-item>
-               <a-descriptions-item label="备货单号">{{ detailData&&detailData.dispatchBillNo || '--' }}</a-descriptions-item>
-               <a-descriptions-item label="收货客户名称">{{ detailData&&detailData.receiverName || '--' }}</a-descriptions-item>
-               <a-descriptions-item label="发货编号">{{ detailData&&detailData.sendNo || '--' }}</a-descriptions-item>
-               <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
-               <a-descriptions-item label="收货人" v-if="detailData&&detailData.salesBillExtEntity">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
-               <a-descriptions-item label="收货电话" v-if="detailData&&detailData.salesBillExtEntity">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
-               <a-descriptions-item label="收货地址" :span="2" v-if="detailData&&detailData.salesBillExtEntity">
-                 {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}
-                 {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCityName || '' }}
-                 {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCountyName || '' }}
-                 {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddr || '' }}
-               </a-descriptions-item>
-               <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
-               <a-descriptions-item label="备注">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
-             </a-descriptions>
+            <a-descriptions size="small" :column="3">
+              <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="销售单号">{{ detailData&&detailData.salesBillNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="备货单号">{{ detailData&&detailData.dispatchBillNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货客户名称">{{ detailData&&detailData.receiverName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="发货编号">{{ detailData&&detailData.sendNo || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货人" v-if="detailData&&detailData.salesBillExtEntity">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货电话" v-if="detailData&&detailData.salesBillExtEntity">{{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="收货地址" :span="2" v-if="detailData&&detailData.salesBillExtEntity">
+                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}
+                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCityName || '' }}
+                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCountyName || '' }}
+                {{ detailData&&detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddr || '' }}
+              </a-descriptions-item>
+              <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="备注">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
+            </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
       </div>
       <a-card size="small" :bordered="false" class="pages-wrap">
-        <!-- alert -->
+        <!-- 统计信息 -->
         <a-alert type="info" style="margin-bottom: 10px;" v-if="detailData!=null">
           <div slot="message">
             <span v-if="$route.params.type!='stockOut'">
@@ -128,7 +128,7 @@
             <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
             <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
           </template>
-           <!-- 销售价 -->
+          <!-- 销售价 -->
           <template slot="price" slot-scope="text, record">
             {{ toThousands(text) }}
             <span v-if="record.promotionFlag=='GIFT'||record.promotionFlag=='DISCOUNT'" title="原价">({{ toThousands(record.origPrice) }})</span>
@@ -221,6 +221,7 @@ export default {
     }
   },
   computed: {
+    // 以下2中状态下不显示打印按钮
     hasNoPrint () {
       return this.detailData && (this.detailData.printStatus == 'UNABLE_PRINT' || this.detailData.printStatus == 'CANCEL_PRINT')
     },
@@ -238,7 +239,7 @@ export default {
         // { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('B_dispatchDetail_salesPrice')) { //  售价权限
-        arr.splice(5, 0, { title: '销售价格', dataIndex: 'price', width: '8%', align: 'right', scopedSlots: { customRender: 'price' }, })
+        arr.splice(5, 0, { title: '销售价格', dataIndex: 'price', width: '8%', align: 'right', scopedSlots: { customRender: 'price' } })
         arr.splice(9, 0, { title: '本次下推金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       if (this.$hasPermissions('B_dispatchDetail_cityPrice')) { //  市级权限
@@ -248,7 +249,7 @@ export default {
     }
   },
   watch: {
-    showDetail(newValue, oldValue) {
+    showDetail (newValue, oldValue) {
       this.getTableHeight()
     }
   },
@@ -257,7 +258,8 @@ export default {
     handleBack () {
       this.$router.push({ name: 'pushOrderManagementList' })
     },
-    getTableHeight(){
+    // 计算表格高度
+    getTableHeight () {
       this.tableHeight = this.outBizSubSn || this.bizSn ? 300 : (window.innerHeight - (this.showDetail ? 403 : 265))
     },
     //  详情
@@ -323,11 +325,11 @@ export default {
           params.type = params.type + '_STACK_PLACE'
         }
         // 原厂编码
-        if(obj.origCode == 1){
+        if (obj.origCode == 1) {
           params.type = params.type + '_ORIG_CODE'
         }
         // 装箱号
-        if(obj.packNo == 1){
+        if (obj.packNo == 1) {
           params.type = params.type + '_PACK_NUM'
         }
         printBase64Fun(
@@ -335,7 +337,7 @@ export default {
           Object.assign(params, obj || {}),
           type,
           taskName,
-          () => { 
+          () => {
             _this.spinning = false
             _this.$store.state.app.curActionPermission = ''
           },

+ 6 - 5
src/views/salesManagement/pushOrderManagement/detailForOut.vue

@@ -179,15 +179,16 @@ export default {
         })
       },
       detailData: null, //  详情数据
-      openModal: false,
-      localDataSource: [],
+      openModal: false, // 发货分类打印弹框
+      localDataSource: [], // 原始数据
       nowPrintType: '', //  当前打印类型
-      openExcelModal: false,
-      fromRouter: null,
-      nowType: 'print',
+      openExcelModal: false, // 导出弹框
+      fromRouter: null, // 页面来源
+      nowType: 'print' // 操作类型
     }
   },
   computed: {
+    // 是否可打印
     hasNoPrint () {
       return this.detailData && (this.detailData.printStatus == 'UNABLE_PRINT' || this.detailData.printStatus == 'CANCEL_PRINT')
     },

+ 6 - 5
src/views/salesManagement/pushOrderManagement/explainInfoModal.vue

@@ -53,13 +53,13 @@ export default {
       type: Boolean,
       default: false
     },
-    rowData: {
+    rowData: { // 当前操作数据
       type: Object,
       default: function () {
         return null
       }
     },
-    mode: {
+    mode: { // 操作模式,编辑or查看
       type: String,
       default: 'edit'
     }
@@ -68,9 +68,9 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
-      showInput: false,
-      explainInfo: '',
-      infoList: []
+      showInput: false, // 是否显示表单组件
+      explainInfo: '', // 发货说明
+      infoList: [] // 发货详细列表
     }
   },
   methods: {
@@ -98,6 +98,7 @@ export default {
         this.spinning = false
       })
     },
+    // 获取发货单明细
     getInfo () {
       this.spinning = true
       queryExplainList({ dispatchBillSn: this.rowData.dispatchBillSn }).then(res => {

+ 52 - 40
src/views/salesManagement/pushOrderManagement/list.vue

@@ -68,27 +68,27 @@
                 <a-form-item label="对单状态">
                   <v-select
                     v-model="queryParam.checkStatus"
-                    ref="printStatus"
-                    id="pushOrder-printStatus"
+                    ref="checkStatus"
+                    id="pushOrder-checkStatus"
                     code="CHECK_STATUS"
                     placeholder="请选择对单状态"
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="所在区域">
+                <a-form-item label="所在区域">
                   <subarea id="pushOrder-subarea" ref="subarea" @change="subareaChange"></subarea>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
+                <a-form-item label="地区" prop="shippingAddrProvinceSn">
                   <Area id="pushOrder-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowWarehouse">
-                <a-form-model-item label="出库仓库">
+                <a-form-item label="出库仓库">
                   <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
-                </a-form-model-item>
+                </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
                 <a-form-item label="客服">
@@ -110,9 +110,9 @@
         </a-form>
       </div>
     </a-card>
-
     <a-card size="small" :bordered="false" class="pushOrder-wrap">
       <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 统计 -->
         <div class="tongji-bar" style="margin-bottom:10px">
           下推总单数:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
           下推总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
@@ -167,7 +167,7 @@
           </template>
         </s-table>
 
-        <!-- 操作提示 -->
+        <!-- 允许此单进行备货打印操作提示 -->
         <commonModal modalTit="操作提示" :openModal="showTipModal" @cancel="canselModal" @ok="updatePrintStatus">
           <div style="display:flex;flex-direction: column;align-items: center;">
             <div style="margin-bottom: 15px;font-size: 14px;"><strong>{{ tipData&&tipData.printType==1?'确认允许此单进行备货打印吗?':'确认此单取消备货打印吗?' }}</strong></div>
@@ -188,6 +188,7 @@
           @cancel="closeDetailModal">
           <salesDetail v-if="showDetailModal" ref="salesDetail" :bizSn="bizSn"></salesDetail>
         </commonModal>
+
         <!-- 发货说明 -->
         <explainInfoModal v-drag :rowData="tipData" :openModal="showInfoModal" @close="canselModal"></explainInfoModal>
       </a-spin>
@@ -219,41 +220,41 @@ export default {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      showDetailModal: false,
-      showInfoModal: false,
-      bizSn: null,
-      tableHeight: 0,
+      showDetailModal: false, // 销售单详情弹框
+      showInfoModal: false, // 发货说明弹框
+      bizSn: null, // 当前操作的销售单sn
+      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,
+        beginDate: getDate.getThreeMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime, // 结束时间
         buyerSn: undefined, //  客户名称
         receiverSn: undefined, // 收货客户
         salesBillNo: '', //  销售单号
         dispatchBillNo: '', //  备货单号
         billStatus: undefined, //  业务状态
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined // 分区
         },
-        voidFlag: undefined,
-        shippingAddrProvinceSn: undefined,
-        printStatus: undefined,
-        checkStatus: undefined,
-        warehouseSn: undefined,
-        bizUserSn: undefined
+        voidFlag: undefined, // 单据状态
+        shippingAddrProvinceSn: undefined, // 地区 省
+        printStatus: undefined, // 备货打印状态
+        checkStatus: undefined, // 对单状态
+        warehouseSn: undefined, // 仓库
+        bizUserSn: undefined // 客服
       },
-      totalData: {
-        totalAmount: 0,
-        totalQty: 0,
-        totalRecord: 0
+      totalData: { // 统计数据
+        totalAmount: 0, // 总金额
+        totalQty: 0, // 总数量
+        totalRecord: 0 // 总条数
       },
-      showTipModal: false,
-      tipData: null,
+      showTipModal: false, // 确认弹框操作提示
+      tipData: null, // 发货说明 数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -292,7 +293,6 @@ export default {
         { title: '出库仓库', dataIndex: 'warehouseName', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品款数', dataIndex: 'totalCategory', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品数量', dataIndex: 'totalQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '总售价', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '备货打印状态', dataIndex: 'printStatusDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款打印状态', dataIndex: 'settlePrintStateDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
@@ -303,25 +303,33 @@ export default {
         { title: '出库时间', dataIndex: 'stockOutDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center', fixed: 'right' }
       ]
-      if (this.$hasPermissions('M_pushOrderManagementList_salesPrice')) { //  售价权限
+      //  售价权限
+      if (this.$hasPermissions('M_pushOrderManagementList_salesPrice')) {
         arr.splice(10, 0, { title: '总售价', dataIndex: 'totalAmount', width: '80px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       return arr
     }
   },
   methods: {
-    //  时间  change
+    //  选择时间
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 客户名称
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
+    // 选择区域
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+    },
+    // 收货客户名称
     shcustChange (val) {
       this.queryParam.receiverSn = val.key
     },
-    // 详情
+    // 详情,type 0 销售订单 1 销售退单
     handleDetail (row, type) {
       if (type == 0) {
         this.$store.state.app.curActionPermission = 'B_salesDetail'
@@ -331,6 +339,7 @@ export default {
         this.$router.push({ name: 'pushOrderDetail', params: { sn: row.dispatchBillSn, type: 'pushOrder' } })
       }
     },
+    // 详情弹框关闭
     closeDetailModal () {
       this.showDetailModal = false
       this.$store.state.app.curActionPermission = ''
@@ -346,13 +355,18 @@ export default {
       this.tipData.printType = type
       this.showTipModal = true
     },
+    // 发货说明弹框关闭
     canselModal () {
       this.tipData = null
       this.showTipModal = false
       this.showInfoModal = false
     },
+    // 确认允许此单进行备货打印
     updatePrintStatus () {
-      dispatchPrintStatus({ dispatchBillSn: this.tipData.dispatchBillSn, printStatus: this.tipData && this.tipData.printType == 1 ? 'NO_PRINT' : 'CANCEL_PRINT' }).then(res => {
+      dispatchPrintStatus({
+        dispatchBillSn: this.tipData.dispatchBillSn,
+        printStatus: this.tipData && this.tipData.printType == 1 ? 'NO_PRINT' : 'CANCEL_PRINT'
+      }).then(res => {
         if (res.status == 200) {
           this.canselModal()
           this.$message.info(res.message)
@@ -360,11 +374,7 @@ export default {
         }
       })
     },
-    subareaChange (val) {
-      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
-      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
-    },
-    // 重置
+    // 重置查询
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
@@ -390,12 +400,14 @@ export default {
       }
       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 - 230

+ 8 - 6
src/views/salesManagement/pushOrderManagement/sendTypeModal.vue

@@ -94,15 +94,15 @@ export default {
       type: Boolean,
       default: false
     },
-    outBizSubSn: {
+    outBizSubSn: { // 单据sn
       type: [Number, String],
       default: ''
     },
-    hasNoPrint: {
+    hasNoPrint: { // 是否显示打印按钮
       type: Boolean,
       default: false
     },
-    nowType: {
+    nowType: { // 操作类型,打印or导出
       type: String,
       default: 'print'
     }
@@ -110,12 +110,13 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      form: {
+      form: { // 打印、导出选项
         id: 'all',
         orderBy: undefined,
         origCode: '0',
         packNo: '1'
       },
+      // 规则校验
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         orderBy: [{ required: true, message: '请选择货位编号', trigger: 'change' }],
@@ -127,8 +128,8 @@ export default {
         wrapperCol: { span: 15 }
       },
       spinning: false,
-      typeList: [],
-      detailData: null
+      typeList: [], // 产品分类
+      detailData: null // 详细信息
     }
   },
   methods: {
@@ -181,6 +182,7 @@ export default {
         }
       })
     },
+    // 赋值
     setData (data, dispatchBillSn) {
       this.detailData = data
       this.getTypeData(dispatchBillSn)

+ 5 - 5
src/views/salesManagement/pushOrderManagement/uniqueCodeModal.vue

@@ -80,7 +80,7 @@ export default {
       type: String,
       default: null
     },
-    chooseData: {
+    chooseData: { // 已选数据
       type: Array,
       default: function () {
         return []
@@ -94,11 +94,11 @@ export default {
       spinning: false,
       handlePlData: [],
       queryParam: {
-        outBizSubNo: '',
-        demanderName: '',
+        outBizSubNo: '', // 产品编码
+        demanderName: '', // 产品名称
         receiverSn: undefined,
-        warehouseSn: undefined,
-        outBizTypeList: ['SALES', 'ALLOCATE']
+        warehouseSn: undefined, // 仓库
+        outBizTypeList: ['SALES', 'ALLOCATE'] // 单据类型
       },
       orginData: [],
       // 加载数据方法 必须为 Promise 对象

+ 16 - 14
src/views/salesManagement/salesCollection/detailModal.vue

@@ -160,19 +160,19 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       disabled: false,
       spinning: false,
-      showDetailModal: false,
-      handlePlData: [],
-      applyDate: [],
+      showDetailModal: false, // 财务收款详情
+      handlePlData: [], // 批量操作数据
+      applyDate: [], // 申请时间默认值
       queryParam: {
-        payerName: undefined,
-        bookNo: '',
-        bookReason: '',
-        applyPersonSn: undefined,
-        status: 'AUDIT_PASS',
-        auditBeginDate: undefined,
-        auditEndDate: undefined
+        payerName: undefined, // 付款方
+        bookNo: '', // 收款单号
+        bookReason: '', // 财务收款事由
+        applyPersonSn: undefined, // 申请人
+        status: 'AUDIT_PASS', // 状态
+        auditBeginDate: undefined, // 审核开始时间
+        auditEndDate: undefined // 审核结束时间
       },
-      chooseData: [],
+      chooseData: [], // 已选数据
       columns: [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款单号', scopedSlots: { customRender: 'bookNo' }, width: '8%', align: 'center' },
@@ -188,7 +188,7 @@ export default {
         { title: '状态', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
-      orginData: [],
+      orginData: [], // 原始数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -214,6 +214,7 @@ export default {
     }
   },
   computed: {
+    // 总金额
     totalAmount () {
       let ret = 0
       this.handlePlData.map(item => {
@@ -230,10 +231,12 @@ export default {
         this.$refs.detailModal.pageInit(row.bookSn)
       })
     },
+    // 赋值
     setData (data, snList) {
       this.handlePlData = data
       this.snList = snList
     },
+    // 选择申请时间
     dateApplyChange (date) {
       this.queryParam.auditBeginDate = date[0]
       this.queryParam.auditEndDate = date[1]
@@ -252,7 +255,6 @@ export default {
       row.checked = true
       this.chooseData.push(row)
     },
-    // 获取sn
     // 确定收款
     handleCommonOk () {
       const snList = this.snList
@@ -260,7 +262,7 @@ export default {
       this.chooseData.map(item => {
         bookSnList.push(item.bookSn)
       })
-
+      // 有财务收款单
       if (bookSnList.length) {
         this.spinning = true
         settleReceiptBookBatch({

+ 46 - 36
src/views/salesManagement/salesCollection/list.vue

@@ -236,42 +236,42 @@ export default {
   data () {
     return {
       spinning: false,
-      showDetail: false,
-      showSkModal: false,
-      showVoucher: false,
-      showDetailModal: false,
-      detailType: 2,
-      bizSn: null,
-      tableHeight: 0,
+      showDetail: false, // 详情弹框
+      showSkModal: false, // 收款弹框
+      showVoucher: false, // 凭证弹框
+      showDetailModal: false, // 详情弹框
+      detailType: 2, // 详情类型
+      bizSn: null, // 单据sn
+      tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
-        beginDate: '',
-        endDate: '',
-        bizNo: '',
-        dispatchBillNo: '',
-        beginDateSettle: '',
-        endDateSettle: '',
-        settleClientName: '',
-        receiverName: '',
-        dealerLevel: undefined,
-        settleStyle: undefined,
-        keepType: undefined,
+        beginDate: '', // 开始时间
+        endDate: '', // 结束时间
+        bizNo: '', // 单据号
+        dispatchBillNo: '', // 配送单号
+        beginDateSettle: '', // 收款开始时间
+        endDateSettle: '', // 收款结束时间
+        settleClientName: '', // 结算客户
+        receiverName: '', // 收货人
+        dealerLevel: undefined, // 客户级别
+        settleStyle: undefined, // 收款方式
+        keepType: undefined, // 收款类型
         subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined // 分区
         },
-        billStatus: undefined,
-        settleState: undefined,
-        voidFlag: undefined,
-        dealerProvinceSn: undefined,
-        dealerCitySn: undefined,
-        dealerCountySn: undefined,
-        checkStatus: undefined,
-        bizUserSn: undefined
+        billStatus: undefined, // 业务状态
+        settleState: undefined, // 财务状态
+        voidFlag: undefined, // 单据状态
+        dealerProvinceSn: undefined, // 地区 省
+        dealerCitySn: undefined, // 市
+        dealerCountySn: undefined, // 县
+        checkStatus: undefined, // 对单状态
+        bizUserSn: undefined // 客服
       },
       disabled: false, //  查询、重置按钮是否可操作
       auditDate: [], //  审核时间
-      settleDate: [],
-      advanced: true,
+      settleDate: [], // 收款时间默认值
+      advanced: true, // 收起展开
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -303,6 +303,7 @@ export default {
     showSelect () {
       return this.$hasPermissions('B_salesCollection_receipt')
     },
+    // 总售价计算
     totalAmount () {
       let ret = 0
       this.handlePlData.map(item => {
@@ -321,7 +322,6 @@ export default {
         { title: '收货客户名称', dataIndex: 'receiverName', align: 'left', width: '10%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品款数', dataIndex: 'totalCategory', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '总售价', dataIndex: 'totalAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '收款类型', dataIndex: 'keepTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款时间', dataIndex: 'settleTime', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款方式', dataIndex: 'settleStyleDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -338,9 +338,11 @@ export default {
     }
   },
   methods: {
+    // 客户名称
     custChange (val) {
       this.queryParam.settleClientName = val.name
     },
+    // 收货客户名称
     receiverChange (val) {
       this.queryParam.receiverName = val.name
     },
@@ -348,25 +350,27 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
-    //  审核时间  change
+    //  选择审核时间  change
     dateAuditChange (date) {
       this.queryParam.beginDate = date[0] ? date[0] : ''
       this.queryParam.endDate = date[1] ? date[1] : ''
     },
-    //  收款时间  change
+    //  选择收款时间  change
     dateSettleChange (date) {
       this.queryParam.beginDateSettle = date[0] ? date[0] : ''
       this.queryParam.endDateSettle = date[1] ? date[1] : ''
     },
+    // 查询列表
     searchTable () {
       this.$refs.table.refresh(true)
       this.$refs.table.clearSelected()
     },
+    // 区域分区
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
-    //  重置
+    //  重置查询
     resetSearchForm () {
       this.auditDate = []
       this.$refs.rangeAuditDate.resetDate(this.auditDate)
@@ -403,12 +407,14 @@ export default {
       this.$refs.table.refresh(true)
       this.$refs.table.clearSelected()
     },
+    // 备货单详情或销售单详情
     handleDetail (row, type) {
       this.detailType = type
       this.bizSn = type == 0 ? row.bizSn : row.dispatchBillSn
       this.$store.state.app.curActionPermission = type == 0 ? 'B_salesDetail' : 'B_dispatchDetail'
       this.showDetailModal = true
     },
+    // 详情弹框关闭
     cancelDetail () {
       this.showDetailModal = false
       this.detailType = 2
@@ -438,7 +444,7 @@ export default {
         })
       }
     },
-    // 凭证
+    // 凭证弹框
     handleVoucher (row) {
       this.$store.state.app.curActionPermission = 'B_salesCollection_record'
       this.showVoucher = true
@@ -446,16 +452,18 @@ export default {
         this.$refs.voucherModal.getData(row)
       })
     },
+    // 凭证弹框关闭
     closeVoucherModal () {
       this.showVoucher = false
       this.$store.state.app.curActionPermission = ''
     },
-    // 点击收款
+    // 点击打开收款弹框
     handleColle (row) {
       this.handlePlData = [row]
       this.$store.state.app.curActionPermission = 'B_salesCollection_receipt'
       this.showSkModal = true
     },
+    // 销售收款弹框关闭
     closeColleModal () {
       this.showSkModal = false
       this.$store.state.app.curActionPermission = ''
@@ -482,12 +490,14 @@ export default {
         }
       })
     },
+    // 初始页面
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
+    // 表格高度计算
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 237

+ 10 - 7
src/views/salesManagement/salesCollection/voucherModal.vue

@@ -140,11 +140,11 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      showTipModal: false,
-      showDetailModal: false,
+      showTipModal: false, // 收款打印预览弹框
+      showDetailModal: false, // 财务收款详情弹框
       disabled: false,
       spinning: false,
-      detail: null,
+      detail: null, // 单据详情数据
       columns: [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款单号', scopedSlots: { customRender: 'bookNo' }, width: '10%', align: 'center' },
@@ -158,10 +158,10 @@ export default {
         { title: '审核时间', dataIndex: 'auditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '状态', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      tableData: [],
-      associatedLoading: false,
-      showCollectDetail: false,
-      handlePlData: null
+      tableData: [], // 列表数据
+      associatedLoading: false, // 关联收款单 按钮 loading
+      showCollectDetail: false, // 关联收款单弹窗
+      handlePlData: null // 批量操作数据
     }
   },
   methods: {
@@ -172,11 +172,13 @@ export default {
         this.$refs.detailModal.pageInit(row.bookSn)
       })
     },
+    // 获取列表数据
     getData (data) {
       this.handlePlData = data
       this.spinning = true
       settleReceiptFindBySn({ sn: data.accountReceiptSn }).then(res => {
         this.detail = res.data || null
+        // 收款类型
         if (res.data.keepType !== 'LABEL_RECEIPT') {
           this.tableData = res.data && res.data.financeBookList || []
           const no = 1
@@ -248,6 +250,7 @@ export default {
         this.$refs.printModel.getData(row, list, true)
       })
     },
+    // 打印预览弹框关闭
     canselPrintView () {
       this.spinning = false
       this.showTipModal = false

+ 31 - 29
src/views/salesManagement/salesOrderWarehouse/detail.vue

@@ -20,28 +20,28 @@
             @click="handlePrint">导出Excel</a-button>
         </template>
       </a-page-header>
-       
+
       <!-- 基础信息 -->
       <a-card size="small" :bordered="false" class="salesDetail-cont" v-show="showDetail">
         <div v-if="detailData">
-         <a-descriptions size="small" :column="3">
-           <a-descriptions-item label="销售单号">{{ detailData.salesBillNo || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="创建时间">{{ detailData.createDate || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="收货地址" :span="2" v-if="detailData&&detailData.salesBillExtEntity">
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCityName || '' }}
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCountyName || '' }}
-             {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddr || '' }}
-           </a-descriptions-item>
-           <a-descriptions-item label="收货人" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="收货电话" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
-           <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
-         </a-descriptions>
+          <a-descriptions size="small" :column="3">
+            <a-descriptions-item label="销售单号">{{ detailData.salesBillNo || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="创建时间">{{ detailData.createDate || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="客户名称">{{ detailData.buyerName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货地址" :span="2" v-if="detailData&&detailData.salesBillExtEntity">
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCityName || '' }}
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrCountyName || '' }}
+              {{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddr || '' }}
+            </a-descriptions-item>
+            <a-descriptions-item label="收货人" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeName || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="收货电话" v-if="detailData.salesBillExtEntity">{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.consigneeTel || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="业务状态">{{ detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+          </a-descriptions>
         </div>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
-        <!-- alert -->
+        <!-- 统计 -->
         <a-alert type="info" style="margin-bottom: 10px;" v-if="countData">
           <div slot="message">
             <span>
@@ -88,7 +88,7 @@ import printModal from './printModal.vue'
 export default {
   name: 'SalesOrderWarehouseDetail',
   mixins: [commonMixin],
-  components: { STable, VSelect ,printModal},
+  components: { STable, VSelect, printModal },
   data () {
     return {
       disabled: false,
@@ -111,10 +111,10 @@ export default {
       },
       detailData: null, //  详情数据
       countData: null, // 数量数据
-      fromRouter: null,
-      openModal:false,
-      showDetail: false,
-      tableHeight: 300
+      fromRouter: null, // 打开此页面的来源页面
+      openModal: false, // 导出Excel
+      showDetail: false, // 是否显示详情
+      tableHeight: 300 // 表格高度
     }
   },
   computed: {
@@ -131,25 +131,27 @@ export default {
         arr.splice(4, 0, { title: '出库仓库', dataIndex: 'warehouseName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
       }
       return arr
-    },
+    }
   },
   watch: {
-    showDetail(newValue, oldValue) {
+    // 监听详情显示隐藏,并计算表格高度
+    showDetail (newValue, oldValue) {
       this.getTableHeight()
     }
   },
   methods: {
-    getTableHeight(){
-      this.tableHeight =  window.innerHeight - (this.showDetail ? 376 : 265)
+    // 表格高度
+    getTableHeight () {
+      this.tableHeight = window.innerHeight - (this.showDetail ? 376 : 265)
     },
-    handlePrint(){
+    // 导出Excel
+    handlePrint () {
       this.openModal = true
     },
     // 确定打印或预览,导出
     handleOk (objs) {
       const _this = this
       const params = JSON.parse(JSON.stringify(objs))
-      console.log(params)
       delete params.type
       _this.spinning = true
       exportExcel(salesDetailExcel, params, '销售清单' + moment().format('YYYYMMDDHHmmss'), () => {
@@ -163,7 +165,7 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesOrderWarehouseList' })
     },
-    //  详情
+    //  获取详情
     getDetail () {
       salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {
@@ -174,7 +176,7 @@ export default {
         }
       })
     },
-    // 数量
+    // 统计数据
     getCount () {
       queryCountForWarehouseDetail({ salesBillSn: this.$route.params.sn, warehouseSn: this.$route.params.wsn }).then(res => {
         if (res.status == 200) {

+ 113 - 109
src/views/salesManagement/salesOrderWarehouse/list.vue

@@ -1,102 +1,102 @@
 <template>
   <div>
-  <!-- 搜索条件 -->
-  <a-card size="small" :bordered="false" class="searchBoxNormal">
-    <div ref="tableSearch" class="table-page-search-wrapper">
-      <a-form-model
-        id="salesOrderWarehouseList-form"
-        ref="ruleForm"
-        class="form-model-con"
-        layout="inline"
-        :rules="rules"
-        :model="queryParam"
-        @keyup.enter.native="handleSearch">
-        <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="创建时间" prop="time">
-              <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="客户名称">
-              <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesManagementList-buyerName" @change="custChange" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="销售单号">
-              <a-input id="salesOrderWarehouseList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="业务状态">
-              <v-select
-                v-model="queryParam.billStatus"
-                ref="billStatus"
-                id="salesManagementList-billStatus"
-                code="SALES_BILL_STATUS"
-                placeholder="请选择业务状态"
-                allowClear></v-select>
-            </a-form-model-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
-              <Area id="salesOrderWarehouseList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
-            </a-form-model-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">
-            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesOrderWarehouseList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesOrderWarehouseList-reset">重置</a-button>
-            <a-button
-              style="margin-left: 10px"
-              type="primary"
-              class="button-warning"
-              @click="handleExport"
-              :disabled="disabled"
-              :loading="exportLoading"
-              v-if="$hasPermissions('B_salesOrderWarehouseExport')"
-            >导出</a-button>
-          </a-col>
-        </a-row>
-      </a-form-model>
-    </div>
-  </a-card>
- 
-  <a-card size="small" :bordered="false" class="salesOrderWarehouseList-wrap">
-    <a-spin :spinning="spinning" tip="Loading...">
-      <div class="tongji-bar" style="margin-bottom:10px">
-        <!-- 总款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '0' }}</strong>; -->
-        总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+    <!-- 搜索条件 -->
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form-model
+          id="salesOrderWarehouseList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="创建时间" prop="time">
+                <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="客户名称">
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesManagementList-buyerName" @change="custChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="销售单号">
+                <a-input id="salesOrderWarehouseList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="业务状态">
+                <v-select
+                  v-model="queryParam.billStatus"
+                  ref="billStatus"
+                  id="salesManagementList-billStatus"
+                  code="SALES_BILL_STATUS"
+                  placeholder="请选择业务状态"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="地区" prop="shippingAddrProvinceSn">
+                <Area id="salesOrderWarehouseList-shippingAddrProvinceSn" v-model="queryParam.shippingAddrProvinceSn" placeholder="请选择省"></Area>
+              </a-form-model-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">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesOrderWarehouseList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesOrderWarehouseList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 10px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_salesOrderWarehouseExport')"
+              >导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
       </div>
-      <!-- 列表 -->
-      <s-table
-        class="sTable fixPagination"
-        ref="table"
-        :style="{ height: tableHeight+68+'px' }"
-        size="small"
-        :rowKey="(record) => record.no"
-        rowKeyName="no"
-        :columns="columns"
-        :pageSize="30"
-        :data="loadData"
-        :scroll="{ y: tableHeight }"
-        :defaultLoadData="false"
-        bordered>
-        <!-- 单号 -->
-        <template slot="stockOutNo" slot-scope="text, record" v-if="$hasPermissions('B_salesOrderWarehouseDetail')">
-          <span class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
-          <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
-        </template>
-      </s-table>
-    </a-spin>
-    <!-- 导出提示框 -->
-    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
-  </a-card>
-   </div>
+    </a-card>
+
+    <a-card size="small" :bordered="false" class="salesOrderWarehouseList-wrap">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <div class="tongji-bar" style="margin-bottom:10px">
+          <!-- 总款数:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '0' }}</strong>; -->
+          总数量:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+68+'px' }"
+          size="small"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :columns="columns"
+          :pageSize="30"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 单号 -->
+          <template slot="stockOutNo" slot-scope="text, record" v-if="$hasPermissions('B_salesOrderWarehouseDetail')">
+            <span class="link-bule" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+            <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 导出提示框 -->
+      <reportModal :visible="showExport" @close="showExport=false"></reportModal>
+    </a-card>
+  </div>
 </template>
 
 <script>
@@ -124,21 +124,22 @@ export default {
           moment(getDate.getCurrMonthDays().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, // 结束时间
         buyerSn: '', //  客户名称
         billStatus: 'WAIT_AUDIT', //  业务状态
         salesBillNo: '', // 销售单号
-        shippingAddrProvinceSn: undefined,
-        warehouseSn: undefined
+        shippingAddrProvinceSn: undefined, // 地址sn
+        warehouseSn: undefined // 仓库sn
       },
-      exportLoading: false,
+      exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
       loading: false,
-      totalData: null,
-      showExport: false,
+      totalData: null, // 统计信息
+      showExport: false, // 导出提示框
+      // 校验规则
       rules: {
-        'time': [{ required: true, message: '请选择退货完成时间', trigger: 'change' }]
+        'time': [{ required: true, message: '请选择创建时间', trigger: 'change' }]
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -173,9 +174,10 @@ export default {
         { title: '总数量', dataIndex: 'totalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
-	  if (this.isShowWarehouse) {
-	    arr.splice(5, 0, { title: '出库仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
-	  }
+      // 如果显示仓库
+      if (this.isShowWarehouse) {
+        arr.splice(5, 0, { title: '出库仓库', dataIndex: 'warehouseName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
+      }
       return arr
     }
   },
@@ -192,6 +194,7 @@ export default {
         }
       })
     },
+    // 选择客户
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
@@ -216,7 +219,7 @@ export default {
         _this.showExport = true
       })
     },
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       if (date[0] && date[1]) {
         this.queryParam.time = date
@@ -243,10 +246,11 @@ export default {
       this.queryParam.warehouseSn = undefined
       this.$refs.table.refresh(true)
     },
-    //  详情
+    //  打开详情页面
     handleDetail (row) {
       this.$router.push({ path: `/salesManagement/salesOrderWarehouse/detail/${row.salesBillSn}/${row.warehouseSn}` })
     },
+    // 初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调

+ 21 - 17
src/views/salesManagement/salesOrderWarehouse/printModal.vue

@@ -48,13 +48,13 @@ export default {
       type: Boolean,
       default: false
     },
-    itemData: {
+    itemData: { // 单据详情信息
       type: Object,
       default: () => {
         return null
       }
     },
-    nowType: {
+    nowType: { // 导出类型
       type: String,
       default: ''
     }
@@ -62,12 +62,14 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 导出选项
       form: {
         id: 'all',
         dataScope: 'all',
         priceType: undefined,
-        orgCode: "1"
+        orgCode: '1'
       },
+      // 选项校验
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
@@ -78,7 +80,7 @@ export default {
         wrapperCol: { span: 15 }
       },
       spinning: false,
-      typeList: []
+      typeList: [] // 产品分类
     }
   },
   computed: {
@@ -92,16 +94,17 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-           _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK':'SALES_BILL'
-           _this.form.priceType += _this.form.orgCode == "1" ? '_ORIG_CODE':''
-           const obj = {
-             salesBillSn: _this.itemData.salesBillSn,
-             priceType: _this.form.priceType,
-             dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
-             type: isPrint || 'preview'
-           }
-           _this.$emit('ok', obj)
-           _this.isShow = false
+          // 价格类型
+          _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK' : 'SALES_BILL'
+          _this.form.priceType += _this.form.orgCode == '1' ? '_ORIG_CODE' : ''
+          const obj = {
+            salesBillSn: _this.itemData.salesBillSn,
+            priceType: _this.form.priceType,
+            dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
+            type: isPrint || 'preview'
+          }
+          _this.$emit('ok', obj)
+          _this.isShow = false
         } else {
           console.log('error submit!!')
           return false
@@ -110,8 +113,8 @@ export default {
     },
     // 取消选择分类
     handleCancel () {
-       this.isShow = false
-    },
+      this.isShow = false
+    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -122,11 +125,12 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        // 重置表单
         this.form = {
           id: 'all',
           dataScope: 'all',
           priceType: undefined,
-          orgCode: "1"
+          orgCode: '1'
         }
         this.$refs.ruleForm.resetFields()
       }

+ 14 - 11
src/views/salesManagement/salesQueryNew/chooseCustomModal.vue

@@ -63,16 +63,18 @@ export default {
     return {
       opened: this.show,
       spinning: false,
-      title: '选择客户',
-      confirmLoading: false,
+      title: '选择客户', // 弹框标题
+      confirmLoading: false, // loading
+      // 表单列
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      // 表单数据
       form: {
         buyerSn: undefined, // 客户sn
-        buyerName: '',
-        settleStyleSn: undefined,
+        buyerName: '', // 客户名称
+        settleStyleSn: undefined, // 支付方式
         shippingAddrProvinceSn: '',
         shippingAddrProvinceName: '', // 省
         shippingAddrCitySn: '',
@@ -82,8 +84,9 @@ export default {
         shippingAddr: '', // 详细地址
         consigneeTel: '', // 联系电话
         consigneeName: '', // 联系人名称
-        warehouseSn: undefined
+        warehouseSn: undefined // 仓库
       },
+      // 表单校验规则
       rules: {
         buyerSn: [ { required: true, message: '请选择客户', trigger: ['change', 'blur'] } ],
         settleStyleSn: [ { required: true, message: '请选择支付方式', trigger: ['change', 'blur'] } ],
@@ -95,8 +98,7 @@ export default {
     }
   },
   methods: {
-
-    // 客户 change
+    // 选择客户 change
     custChange (val) {
       if (val && val.key) {
         this.form.buyerSn = val.key || undefined
@@ -113,11 +115,11 @@ export default {
         this.verifyFun(this.addressId)
       }
     },
-    //  选择地址
+    // 打开选择地址弹框
     handleChoose () {
       this.openAddrModal = true
     },
-    //  保存
+    // 保存
     handleSubmit (e) {
       e.preventDefault()
       const _this = this
@@ -125,7 +127,6 @@ export default {
         if (valid) {
           _this.salesSaveFun()
         } else {
-          console.log('error submit!!')
           return false
         }
       })
@@ -149,12 +150,13 @@ export default {
         }
       })
     },
+    // 关闭弹框
     cancel () {
       this.opened = false
       this.$emit('cancel')
       this.$refs.ruleForm.resetFields()
     },
-    //  地址保存
+    // 地址保存
     handleOk (data) {
       this.chooseAddr = (data.consigneeName || '') + '(' + (data.consigneeTel || '-') + ')' + ' ' + (data.address || '')
       this.addressVal = '更换地址'
@@ -172,6 +174,7 @@ export default {
       // 移除表单项的校验结果
       this.$refs.ruleForm.clearValidate('consigneeTel')
     },
+    // 重置地址
     verifyFun (id) {
       if (id == this.addressId) {
         this.chooseAddr = ''

+ 17 - 13
src/views/salesManagement/salesQueryNew/comps/activeQueryPart.vue

@@ -47,6 +47,7 @@
         </a-row>
       </a-form>
     </div>
+    <!-- tab选项卡 -->
     <a-tabs type="card" @change="changeTab">
       <a-tab-pane v-for="item in tabList" :key="item.val" :tab="item.text"></a-tab-pane>
     </a-tabs>
@@ -126,8 +127,8 @@ export default {
     return {
       advanced: false, // 高级搜索 展开/关闭
       showSetting: false, // 设置弹框
-      productType: [],
-      buyerSn: '',
+      productType: [], // 产品类型
+      buyerSn: '', // 客户sn
       queryParam: { //  查询条件
         productCode: '', //  产品编码
         productName: '', //  产品名称
@@ -136,14 +137,14 @@ export default {
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        warehouseSn: undefined
+        warehouseSn: undefined // 仓库sn
       },
       defaultWarehouseSn: undefined, // 默认仓库sn
-      tableHeight: 300,
+      tableHeight: 300, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
-      promoProductClz: 'GATE',
-      promoRuleData: null,
-      tabList: [],
+      promoProductClz: 'GATE', // 促销产品类型
+      promoRuleData: null, // 促销规则数据
+      tabList: [], // 促销产品选项卡
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -158,7 +159,9 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               data.list[i].salesNums = 1
+              // 当前库存数量
               data.list[i].currentStockQty = data.list[i].currentStockQty || 0
+              // 产品包装数
               const productPackQty = (data.list[i].productPackQty || data.list[i].productPackQty == 0) ? data.list[i].productPackQty : '--'
               const productUnit = data.list[i].productUnit || '--'
               const productPackQtyUnit = data.list[i].productPackQtyUnit || '--'
@@ -208,6 +211,7 @@ export default {
     }
   },
   methods: {
+    // 加载仓库
     loadWarehouse (sn) {
       this.defaultWarehouseSn = sn
       this.queryParam.warehouseSn = sn
@@ -220,7 +224,7 @@ export default {
       this.promoProductClz = e
       this.resetSearchForm()
     },
-    // 双击列表
+    // 双击列表添加产品
     handleClickRow (record) {
       const _this = this
       return {
@@ -239,7 +243,7 @@ export default {
         this.$message.info('请选择仓库')
       }
     },
-    //  重置
+    // 重置
     resetSearchForm () {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
@@ -252,6 +256,7 @@ export default {
       this.queryParam.warehouseSn = this.defaultWarehouseSn
       this.$refs.table.refresh(true)
     },
+    // 页面初始化
     pageInit (data, promo) {
       this.buyerSn = data.buyerSn
       this.promoRuleData = promo.promotionRule
@@ -263,7 +268,7 @@ export default {
       const isMcpScp = this.promoRuleData && this.promoRuleData.convertExpenseFlag == 1 && this.promoRuleData.promotionRuleType == 'BUY_PROD_GIVE_PROD'
       // 是否卖产品送采购额
       const isMcpScge = this.promoRuleData.promotionRuleType == 'BUY_PROD_GIVE_MONEY' && this.promoRuleData.scopeFlag === '1'
-
+      // 选项卡数据
       const tabList = []
       if (this.promoRuleData) {
         if (this.promoRuleData.gateFlag === '1') {
@@ -283,7 +288,6 @@ export default {
       this.tabList = tabList
       this.promoProductClz = tabList[0].val
       this.tableHeight = window.innerHeight - 330
-
       this.queryParam.scopeLevel = promo.countData.scopeLevel
       this.resetSearchForm()
     },
@@ -294,11 +298,11 @@ export default {
         _this.$refs.table.refresh()
       })
     },
-    // 选择配件
+    // 添加产品
     handleAdd (row) {
       this.$emit('add', row, 0, this.promoProductClz)
     },
-    //  产品分类  change
+    // 选择产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''

+ 8 - 4
src/views/salesManagement/salesQueryNew/comps/chooseImportModal.vue

@@ -23,6 +23,7 @@
         :pagination="false"
         bordered>
       </a-table>
+      <!-- 分割线 -->
       <a-divider />
       <!-- 不可导入数据 -->
       <p class="red">不可导入数据{{ unLoadData.length }}条</p>
@@ -77,7 +78,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: Object,
       default: () => {
         return {}
@@ -87,6 +88,7 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 正常列
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -97,6 +99,7 @@ export default {
         { title: '单位', dataIndex: 'productUnit', width: '14%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
       loadData: [],
+      // 错误项列
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -112,11 +115,12 @@ export default {
     }
   },
   methods: {
+    // 获取数据,并格式化
     getData () {
       const paramsData = JSON.parse(JSON.stringify(this.paramsData))
-      console.log(paramsData)
-      this.loadData = paramsData.rightList || []
-      this.unLoadData = paramsData.errorList || []
+      this.loadData = paramsData.rightList || [] // 可导入数据
+      this.unLoadData = paramsData.errorList || [] // 错误数据
+      // 格式化序号
       this.loadData.map((item, index) => {
         item.no = index + 1
       })

+ 22 - 19
src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue

@@ -10,15 +10,15 @@
     :headerStyle="{ padding: '10px' }"
     @close="onClose"
     wrapClassName="chooseProducts-modal">
-      <a-spin :spinning="spinning" tip="Loading...">
-        <div class="products-con">
-          <div>
-            <!-- 查询配件列表 -->
-            <queryPart v-if="cptype==0" ref="partQuery" :newLoading="isInster" @add="insterProduct"></queryPart>
-            <activeQueryPart v-if="cptype==1" ref="partQuery" :newLoading="isInster" @add="insterProduct"></activeQueryPart>
-          </div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="products-con">
+        <div>
+          <!-- 查询配件列表 -->
+          <queryPart v-if="cptype==0" ref="partQuery" :newLoading="isInster" @add="insterProduct"></queryPart>
+          <activeQueryPart v-if="cptype==1" ref="partQuery" :newLoading="isInster" @add="insterProduct"></activeQueryPart>
         </div>
-      </a-spin>
+      </div>
+    </a-spin>
   </a-drawer>
 </template>
 
@@ -33,7 +33,7 @@ export default {
       type: Boolean,
       default: false
     },
-    chooseData: {
+    chooseData: { // 已选数据
       type: Array,
       default: () => {
         return []
@@ -43,33 +43,36 @@ export default {
       type: Boolean,
       default: false
     },
-    zIndex:{
-      type: [String,Number],
+    zIndex: { // 层级
+      type: [String, Number],
       default: 1000
     }
   },
   data () {
     return {
       spinning: false,
-      cptype: 3,
+      cptype: 3, // 组件类型
       isShow: this.openModal, //  是否打开弹框
-      orderData: null
+      orderData: null // 订单数据
     }
   },
-  
+
   methods: {
+    // 关闭弹框
     onClose () {
       this.$emit('close')
     },
-    // 添加产品
+    // 添加产品,
+    // row 产品信息, promotionFlag 是否促销产品, promoProductClz 促销产品类型
     insterProduct (row, promotionFlag, promoProductClz) {
       this.$emit('addProduct', row, promotionFlag, promoProductClz)
     },
-    pageInit(data, promo, type){
-      console.log(data, promo, type)
+    // 初始化数据,
+    // data 订单数据, promo 促销活动数据, type 组件类型
+    pageInit (data, promo, type) {
       this.cptype = type
       this.orderData = data
-      this.$nextTick(()=>{
+      this.$nextTick(() => {
         this.$refs.partQuery.pageInit(data, promo)
       })
     }
@@ -82,7 +85,7 @@ export default {
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
-        this.$emit('close',this.cptype)
+        this.$emit('close', this.cptype)
         this.cptype = 3
       }
     }

+ 405 - 381
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -1,397 +1,421 @@
 <template>
-    <!-- 已选配件列表 -->
-    <a-spin :spinning="spinning" tip="Loading...">
-          <ve-table
-            border-y
-            v-show="!showEmpty"
-            :scroll-width="0"
-            :max-height="tableHeight"
-            :show-header="showTableHead"
-            :row-style-option="{clickHighlight: true}"
-            :cellSelectionOption="{enable: false}"
-            :virtual-scroll-option="{enable: true}"
-            :columns="columns"
-            :table-data="dataSource"
-            row-key-field-name="id"
-            :cell-style-option="cellStyleOption"
-            :cell-span-option="cellSpanOption"
-            :column-width-resize-option="columnWidthResizeOption"
-          />
-        <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
-        <!-- 活动规则详情 -->
-        <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
-    </a-spin>
-  </template>
-  
-  <script>
-    import { commonMixin } from '@/utils/mixin'
-    import { Empty } from 'ant-design-vue';
-    import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detailModal.vue'
-    import { salesPromoQueryList } from '@/api/salesNew'
-    import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
-    export default {
-      name: 'DetailProductList',
-      mixins: [commonMixin],
-      components: { detailModal },
-      props: {
-        newLoading: Boolean,
-        detailData: {
-          type: Object,
-          default: function(){return null}
-        },
-        promo: {
-          type: Object,
-          default: function(){return null}
-        },
-        id: {
-          type: String,
-          default: ''
-        },
-        warehouseSn: {
-          type: String,
-          default: ''
-        },
-        promoFlag: {
-          type: String,
-          default: ''
-        },
-        salesBillSn: {
-          type: String,
-          default: ''
-        },
-        showCityPrice: {
-            type: Boolean,
-            default: false
-        },
-        authCode: {
-          type: String,
-          default: ''
-        },
-        maxHeight:{
-          type: [String,Number],
-          default: '300'
-        },
-        showHeader: {
-            type: Boolean,
-            default: true
+  <!-- 已选配件列表 -->
+  <a-spin :spinning="spinning" tip="Loading...">
+    <ve-table
+      border-y
+      v-show="!showEmpty"
+      :scroll-width="0"
+      :max-height="tableHeight"
+      :show-header="showTableHead"
+      :row-style-option="{clickHighlight: true}"
+      :cellSelectionOption="{enable: false}"
+      :virtual-scroll-option="{enable: true}"
+      :columns="columns"
+      :table-data="dataSource"
+      row-key-field-name="id"
+      :cell-style-option="cellStyleOption"
+      :cell-span-option="cellSpanOption"
+      :column-width-resize-option="columnWidthResizeOption"
+    />
+    <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
+    <!-- 活动规则详情 -->
+    <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
+  </a-spin>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { Empty } from 'ant-design-vue'
+import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detailModal.vue'
+import { salesPromoQueryList } from '@/api/salesNew'
+import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
+export default {
+  name: 'DetailProductList',
+  mixins: [commonMixin],
+  components: { detailModal },
+  props: {
+    newLoading: Boolean, // loading
+    detailData: { // 详情信息
+      type: Object,
+      default: function () { return null }
+    },
+    // 活动规则详情
+    promo: {
+      type: Object,
+      default: function () { return null }
+    },
+    // 表格id
+    id: {
+      type: String,
+      default: ''
+    },
+    // 仓库sn
+    warehouseSn: {
+      type: String,
+      default: ''
+    },
+    // 是否促销产品
+    promoFlag: {
+      type: String,
+      default: ''
+    },
+    // 销售单sn
+    salesBillSn: {
+      type: String,
+      default: ''
+    },
+    // 是否显示城市价格
+    showCityPrice: {
+      type: Boolean,
+      default: false
+    },
+    // 权限码
+    authCode: {
+      type: String,
+      default: ''
+    },
+    // 最大高度
+    maxHeight: {
+      type: [String, Number],
+      default: '300'
+    },
+    // 是否显示表格头部
+    showHeader: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      openDetailModal: false, // 活动规则详情弹框
+      detailSn: null, // 活动规则详情sn
+      activeList: [], // 活动列表
+      dataSource: [], // 列表原始数据
+      tableHeight: this.maxHeight, // 表格高度
+      // 自定义单元格样式
+      cellStyleOption: {
+        bodyCellClass: ({ row, column, rowIndex }) => {
+          if (row.id.indexOf('promo-') >= 0 && column.field === 'no') {
+            return 'table-body-cell-no'
+          }
         }
       },
-      data () {
-        return {
-          spinning: false,
-          openDetailModal: false,
-          detailSn: null,
-          activeList: [], // 活动列表
-          dataSource: [],
-          tableHeight: this.maxHeight,
-          cellStyleOption: {
-            bodyCellClass: ({ row, column, rowIndex }) => {
-                if (row.id.indexOf('promo-')>=0 && column.field === "no") {
-                    return "table-body-cell-no";
-                }
-            },
-          },
-          columnWidthResizeOption: {
-              // default false
-              enable: true,
-              // column resize min width
-              minWidth: 50
-          },
-          cellSpanOption: {
-              bodyCellSpan: this.bodyCellSpan,
-          },
-          isCityPrice: false,
-          outStockStr: '',
-          showEmpty: false,
-          showTableHead: true,
-          colspanNums: 13,
-          hasOutStockOfActive: false,
-          simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
-        }
+      // 表格列可拖曳
+      columnWidthResizeOption: {
+        // default false
+        enable: true,
+        // column resize min width
+        minWidth: 50
       },
-      computed: {
-        columns () {
-          const _this = this
-          const priceFormat = function(data){
-            return _this.toThousands(data) || '--'
-          }
-          const numsFormat = function(data){
-            return data || data == 0 ? data : '--'
-          }
-          const codeFormat = function(record,data,h){
-            let ftext = ''
-            let fcolor = ''
-            if(record.promotionFlag == 'GIFT'){
-              ftext = '促'
-              fcolor = '#52c41a'
-            }
-            if(record.promotionFlag == 'GATE'){
-              ftext = '槛'
-              fcolor = '#108ee9'
-            }
-             
-            return (
-                    <div>
-                        <span style="padding-right: 15px;">{data}</span>
-                        {ftext?(<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom:'80%' }}></a-badge>):''}
-                        {record.convertPromoGiftsQty?(<a-badge count="转" number-style={{ backgroundColor: '#ffaa00', zoom:'80%' }}></a-badge>):''}
-                        {(Number(record.stockQty||0) < Number(record.unpushedQty||0)) && _this.showStock?(<a-badge count="缺" number-style={{ zoom:'80%' }}></a-badge>):''}
-                    </div>
-                )
-          }
-          // 编号,并且格式化活动分类行
-          const noFormat = function(record,data,h){
-            const isBuyPSendP = record.promo && record.promo.promotionRule.convertExpenseFlag==1&&record.promo.promotionRule.promotionRuleType=='BUY_PROD_GIVE_PROD'
-            return (
-              <div>
-                {record.id.indexOf('promo-')>=0 ? (
-                  <div class="active-title">
-                    {record.promo?(
-                      <div>
-                        <strong style="font-size:14px;">{record.promo.promotion.description}</strong>
-                        <span>({record.promo.promotionRule.description})</span>
-                        <span style="margin-left:20px;color:#00aaff;cursor: pointer;" onClick={()=>_this.showDesc(record.promo)}>
-                          <a-icon title="查看活动详情" type="eye"/> 活动详情
-                        </span>
-                      </div>
-                    ):(<div></div>)}
-                    <div>
-                        款数:<strong>{record.total&&record.total.totalCategory||'--'}</strong>;
-                        数量:<strong>{record.total&&record.total.totalQty||'--'}</strong>;
-                        {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total&&record.total.totalAmount||'--'}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount>0&&!isBuyPSendP ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.cgejyAmount<0&&!isBuyPSendP ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>):('')}
-                        {_this.$hasPermissions('B_salesEdit_salesPrice')&&record.promo&&record.total&&record.total.totalPromoGiftsAmount&&isBuyPSendP ? (<span>促销产品转采购额金额:<strong>{_this.toThousands(record.total.totalPromoGiftsAmount)}</strong>;</span>):('')}
-                        {record.total&&record.total.expenseAccountFlag!='WAIT' ? (<span style="color:red;">{record.total.expenseAccountFlagDictValue}</span>) : ''}
-                    </div>
+      // 自定义单元格内容
+      cellSpanOption: {
+        bodyCellSpan: this.bodyCellSpan
+      },
+      isCityPrice: false, // 是否显示市级价
+      outStockStr: '', // 产品库存不足提示信息
+      showEmpty: false, // 是否显示空数据图片
+      showTableHead: true, // 是否显示表格头部
+      colspanNums: 13, // 单元格合并列数
+      hasOutStockOfActive: false,
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE // 空图片
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      // 价格单元格
+      const priceFormat = function (data) {
+        return _this.toThousands(data) || '--'
+      }
+      // 数字单元格
+      const numsFormat = function (data) {
+        return data || data == 0 ? data : '--'
+      }
+      // 销售单号
+      const codeFormat = function (record, data, h) {
+        let ftext = ''
+        let fcolor = ''
+        if (record.promotionFlag == 'GIFT') {
+          ftext = '促'
+          fcolor = '#52c41a'
+        }
+        if (record.promotionFlag == 'GATE') {
+          ftext = '槛'
+          fcolor = '#108ee9'
+        }
+
+        return (
+          <div>
+            <span style="padding-right: 15px;">{data}</span>
+            {ftext ? (<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom: '80%' }}></a-badge>) : ''}
+            {record.convertPromoGiftsQty ? (<a-badge count="转" number-style={{ backgroundColor: '#ffaa00', zoom: '80%' }}></a-badge>) : ''}
+            {(Number(record.stockQty || 0) < Number(record.unpushedQty || 0)) && _this.showStock ? (<a-badge count="缺" number-style={{ zoom: '80%' }}></a-badge>) : ''}
+          </div>
+        )
+      }
+      // 编号,并且格式化活动分类行
+      const noFormat = function (record, data, h) {
+        const isBuyPSendP = record.promo && record.promo.promotionRule.convertExpenseFlag == 1 && record.promo.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_PROD'
+        return (
+          <div>
+            {record.id.indexOf('promo-') >= 0 ? (
+              <div class="active-title">
+                {record.promo ? (
+                  <div>
+                    <strong style="font-size:14px;">{record.promo.promotion.description}</strong>
+                    <span>({record.promo.promotionRule.description})</span>
+                    <span style="margin-left:20px;color:#00aaff;cursor: pointer;" onClick={() => _this.showDesc(record.promo)}>
+                      <a-icon title="查看活动详情" type="eye"/> 活动详情
+                    </span>
                   </div>
-                ):(<span>{data}</span>)}
+                ) : (<div></div>)}
+                <div>
+                  款数:<strong>{record.total && record.total.totalCategory || '--'}</strong>;
+                  数量:<strong>{record.total && record.total.totalQty || '--'}</strong>;
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') ? (<span>总金额:<strong>{record.total && record.total.totalAmount || '--'}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.lossAmount ? (<span>优惠金额:<strong>{record.total.lossAmount}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.cgejyAmount > 0 && !isBuyPSendP ? (<span>采购额结余:<strong>{_this.toThousands(record.total.cgejyAmount)}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.cgejyAmount < 0 && !isBuyPSendP ? (<span>采购额超出:<strong>{_this.toThousands(record.total.cgeccAmount)}</strong>;</span>) : ('')}
+                  {_this.$hasPermissions('B_salesEdit_salesPrice') && record.promo && record.total && record.total.totalPromoGiftsAmount && isBuyPSendP ? (<span>促销产品转采购额金额:<strong>{_this.toThousands(record.total.totalPromoGiftsAmount)}</strong>;</span>) : ('')}
+                  {record.total && record.total.expenseAccountFlag != 'WAIT' ? (<span style="color:red;">{record.total.expenseAccountFlagDictValue}</span>) : ''}
+                </div>
               </div>
-            )
+            ) : (<span>{data}</span>)}
+          </div>
+        )
+      }
+      // 显示折扣价
+      const discountPriceFormat = function (record, data, h) {
+        return (
+          <div>
+            {_this.toThousands(data)}
+            {record.promotionFlag == 'GIFT' || record.promotionFlag == 'DISCOUNT' ? (
+              <span title="原价">({ _this.toThousands(record.origPrice)})</span>
+            ) : ''}
+          </div>
+        )
+      }
+      // 列定义
+      let arr = [
+        { title: '序号', field: 'no', key: 'a', width: 50, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row, row[column.field], h) } },
+        { title: '产品编码', field: 'productCode', key: 'b', width: 150, align: 'left', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row, row[column.field], h) } },
+        { title: '产品名称', field: 'productName', key: 'c', width: 250, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '原厂编码', field: 'productOrigCode', key: 'd', width: 150, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '出库仓库', field: 'warehouseName', key: 'e', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
+      ]
+      // 计算可合并单元格数
+      this.colspanNums = this.showConvertPromoGifts ? 6 : 5
+      if (this.$hasPermissions(this.authCode + '_costPrice')) { //  成本价权限
+        this.colspanNums = this.colspanNums + 1
+        arr.push({ title: '成本价', field: 'showCost', width: 80, key: 'f', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
+      }
+      this.colspanNums = this.colspanNums + 2
+      arr = arr.concat([
+        { title: '单位', field: 'productOrigUnit', key: 'g', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
+        { title: '销售数量', field: 'qty', width: 80, key: 'h', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } }
+      ])
+
+      if (this.$hasPermissions(this.authCode + '_provincePrice')) {
+        this.colspanNums = this.colspanNums + 1
+        arr.push({ title: '省级价', field: 'provincePrice', width: 80, key: 'i', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
+      }
+      // 是否勾选市级价格
+      if (this.isCityPrice) {
+        this.colspanNums = this.colspanNums + 1
+        arr.push({ title: '市级价', field: 'cityPrice', width: 80, key: 'j', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
+        if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
+          this.colspanNums = this.colspanNums + 1
+          arr.push({ title: '销售价', field: 'price', width: 100, key: 'k', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row, row[column.field], h) } })
+        }
+      } else {
+        if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
+          this.colspanNums = this.colspanNums + 1
+          arr.push({ title: '销售价', field: 'price', width: 100, key: 'l', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row, row[column.field], h) } })
+        }
+      }
+      //  审核,需用到库存
+      if (this.showStock) {
+        this.colspanNums = this.colspanNums + 1
+        arr.push({ title: '库存', field: 'stockQty', width: 80, key: 'm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+      }
+      this.colspanNums = this.colspanNums + 3
+      arr = arr.concat([
+        { title: '待下推数', field: 'unpushedQty', width: 80, key: 'o', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
+        { title: '已下推数', field: 'pushedQty', width: 80, key: 'p', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } }
+      ])
+
+      // 如果有转采购额
+      if (this.showConvertPromoGifts) {
+        arr.push({ title: '转采购额数量', field: 'convertPromoGiftsQty', width: 100, key: 'z', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row.convertPromoGiftsFlag ? numsFormat(row[column.field]) : '--' } })
+      }
+      arr.push({ title: '已取消数', field: 'cancelQty', width: 80, key: 'q', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+      return arr
+    },
+    // 是否有可转采购额
+    hasConvertPromoGifts () {
+      return this.detailData && this.detailData.totalConvertPromoGiftsQty
+    },
+    // 是否显示可转采购额
+    showConvertPromoGifts () {
+      return this.activeList && this.activeList.filter(item => item.enabledFlag == 1).find(item => item.promotionRule && item.promotionRule.convertExpenseFlag == 1 && item.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_PROD')
+    },
+    // 是否显示库存列
+    showStock () {
+      return this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')
+    }
+  },
+  watch: {
+    // 是否显示城市价格变化时
+    showCityPrice (newValue, oldValue) {
+      this.isCityPrice = newValue
+    }
+  },
+  methods: {
+    // 关闭详情弹窗
+    closeDetailModal () {
+      this.detailSn = null
+      this.openDetailModal = false
+    },
+    // 合并活动分类单元格
+    bodyCellSpan ({ row, column, rowIndex }) {
+      if (row.id.indexOf('promo-') >= 0) {
+        if (column.field == 'no') {
+          return {
+            rowspan: 1,
+            colspan: this.colspanNums
           }
-          // 显示折扣价
-          const discountPriceFormat = function(record,data,h) {
-            return (
-              <div>
-                {_this.toThousands(data)}
-                {record.promotionFlag == 'GIFT' || record.promotionFlag == 'DISCOUNT' ? (
-                  <span title="原价">({ _this.toThousands(record.origPrice)})</span>
-                ):''}
-              </div>
-            )
+        } else {
+          return {
+            rowspan: 0,
+            colspan: 0
           }
+        }
+      }
+    },
+    // 查看活动详情
+    showDesc (row) {
+      this.detailSn = row.promoRuleSn
+      this.openDetailModal = true
+    },
+    // 获取销售单参与的活动列表
+    pageInit () {
+      salesPromoQueryList({ salesBillSn: this.salesBillSn }).then(res => {
+        if (res.status == 200) {
+          this.activeList = res.data || []
+        }
+        this.$nextTick(() => {
+          this.searchTable()
+        })
+      })
+    },
+    // 查询表格数据
+    async searchTable () {
+      this.dataSource = []
+      this.disabled = true
+      this.spinning = true
+      // 参数
+      const params = {
+        salesBillSn: this.salesBillSn,
+        showStock: this.showStock,
+        warehouseSn: this.warehouseSn,
+        promotionFlag: this.promoFlag == '' ? undefined : this.promoFlag
+      }
+      // 参与活动数据
+      const active = this.activeList.filter(item => item.enabledFlag == 1)
+
+      // 正常产品
+      const hasSearchNormal = !params.promotionFlag || params.promotionFlag == 0
+      const proList = hasSearchNormal ? await salesDetailAllList(params).then(res => res.data) : []
+      const norTotal = hasSearchNormal ? await salesDetaiCount(params).then(res => res.data) : null
 
-          let arr= [
-                { title: '序号', field: 'no',key: "a", width: 50, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row,row[column.field],h)} },
-                { title: '产品编码', field: 'productCode',key: "b", width: 150, align: 'left',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row,row[column.field],h)} },
-                { title: '产品名称', field: 'productName',key: "c", width: 250, align: 'left',operationColumn: false , ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-                { title: '原厂编码', field: 'productOrigCode',key: "d", width: 150, align: 'left',operationColumn: false,ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
-                { title: '出库仓库', field: 'warehouseName',key: "e", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}}
-            ]
-            this.colspanNums = this.showConvertPromoGifts ? 6 : 5
-            if (this.$hasPermissions(this.authCode + '_costPrice')) { //  成本价权限
-              this.colspanNums = this.colspanNums + 1
-              arr.push({ title: '成本价', field: 'showCost', width: 80,key: "f", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
-            }
-            this.colspanNums = this.colspanNums + 2
-            arr = arr.concat([
-                { title: '单位', field: 'productOrigUnit',key: "g", width: 80, align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
-                { title: '销售数量', field: 'qty', width: 80,key: "h", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} }
-            ])
+      // 没有活动时,表格不显示统计数据
+      let listData = active.length ? (proList.length ? [{
+        id: 'promo-normal',
+        total: norTotal
+      }, ...proList] : []) : proList
 
-            if (this.$hasPermissions(this.authCode + '_provincePrice')) {
-              this.colspanNums = this.colspanNums + 1
-              arr.push({ title: '省级价', field: 'provincePrice', width: 80,key: "i", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
-            }
-            // 是否勾选市级价格
-            if (this.isCityPrice) {
-              this.colspanNums = this.colspanNums + 1
-                arr.push({ title: '市级价', field: 'cityPrice', width: 80,key: "j", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field])} })
-                if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-                  this.colspanNums = this.colspanNums + 1
-                    arr.push({ title: '销售价', field: 'price', width: 100,key: "k", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row,row[column.field],h)} })
-                }
-            } else {
-                if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-                  this.colspanNums = this.colspanNums + 1
-                    arr.push({ title: '销售价', field: 'price', width: 100,key: "l", align: 'right',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row,row[column.field],h)} })
-                }
-            }
+      // 有促销活动产品
+      if (params.promotionFlag != 0) {
+        // 循环获取活动产品
+        for (let i = 0; i < active.length; i++) {
+          const promo = active[i]
+          const activeParams = {
+            promoRuleSn: promo.promoRuleSn,
+            promoSn: promo.promoSn,
+            salesPromoSn: promo.salesPromoSn,
+            ...params
+          }
 
-            if (this.showStock) { //  审核,需用到库存
-              this.colspanNums = this.colspanNums + 1
-                arr.push({ title: '库存', field: 'stockQty', width: 80,key: "m", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} })
-            }
-            this.colspanNums = this.colspanNums + 3
-            arr = arr.concat([
-                { title: '待下推数', field: 'unpushedQty', width: 80,key: "o", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
-                { title: '已下推数', field: 'pushedQty', width: 80,key: "p", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} },
-            ])
-            
-            if(this.showConvertPromoGifts){
-              arr.push({ title: '转采购额数量', field: 'convertPromoGiftsQty', width: 100,key: "z", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row.convertPromoGiftsFlag ? numsFormat(row[column.field]) : '--'} })
-            }
-            arr.push({ title: '已取消数', field: 'cancelQty', width: 80,key: "q", align: 'center',operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field])} })
-          return arr
-        },
-        hasConvertPromoGifts(){
-          return this.detailData && this.detailData.totalConvertPromoGiftsQty
-        },
-        showConvertPromoGifts(){
-          return this.activeList&&this.activeList.filter(item=>item.enabledFlag == 1).find(item => item.promotionRule&&item.promotionRule.convertExpenseFlag==1&&item.promotionRule.promotionRuleType=='BUY_PROD_GIVE_PROD')
-        },
-        showStock(){
-            return this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')
+          // 获取活动产品统计
+          const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
+          if (acTotal) {
+            // 采购额结余
+            acTotal.cgejyAmount = (Number(acTotal.totalPromoGiftsAmount || 0) - Number(acTotal.totalUsePromoGiftsAmount || 0)).toFixed(2)
+            // 采购额超出
+            acTotal.cgeccAmount = (Number(acTotal.totalUsePromoGiftsAmount || 0) - Number(acTotal.totalPromoGiftsAmount || 0)).toFixed(2)
+          }
+          // 有数据时才调用接口,避免做无用的调用
+          if (acTotal && acTotal.totalQty) {
+            // 获取活动产品列表
+            const aclist = await salesDetailAllList(activeParams).then(res => res.data)
+            // 合并结果数据
+            const retList = aclist.length ? [{
+              id: 'promo-' + i,
+              promo: promo,
+              total: acTotal
+            }, ...aclist] : []
+            // 将活动产品数据拼接
+            listData = aclist && aclist.length ? listData.concat(retList) : listData
+          }
         }
-      },
-      watch: {
-        showCityPrice(newValue, oldValue){
-            this.isCityPrice = newValue
+        // 如果活动没有任何产品,不显示统计一行
+        if (active.length) {
+          const hasAcp = listData.filter(item => item.id != 'promo-normal').filter(item => item.id.indexOf('promo-') >= 0)
+          if (hasAcp && hasAcp.length == 0) {
+            listData = listData.filter(item => item.id.indexOf('promo-') < 0) || []
+          }
         }
-      },
-      methods: {
-        // 关闭详情弹窗
-        closeDetailModal () {
-          this.detailSn = null
-          this.openDetailModal = false
-        },
-         // 合并活动分类单元格
-        bodyCellSpan({ row, column, rowIndex }) {
-          if (row.id.indexOf('promo-')>=0) {
-            if(column.field=='no'){
-              return {
-                        rowspan: 1,
-                        colspan: this.colspanNums,
-                    };
-            }else{
-              return {
-                    rowspan: 0,
-                    colspan: 0,
-                }
-            }
+      }
+      // 赋值
+      this.dataSource = listData
+      // 格式化数据
+      let f = 0
+      let str = ''
+      this.outStockStr = ''
+      this.dataSource.map((item, i) => {
+        if (item.id.indexOf('promo-') >= 0) { f = f - 1 }
+        item.no = i + 1 + f
+        // 格式化数据
+        const productCode = (item.productEntity && item.productEntity.code) || (item.dealerProductEntity && item.dealerProductEntity.code)
+        const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
+        const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
+        const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
+        item.productCode = productCode || '--'
+        item.productName = productName || '--'
+        item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
+        item.productOrigUnit = productOrigUnit || '--'
+        item.epushedQty = Number(item.pushedQty) - Number(item.pushQty)
+        if (item.unpushedQty && (Number(item.stockQty) < Number(item.unpushedQty))) {
+          str += item.productCode + '、'
+          if (item.promotionFlag != 0) {
+            this.hasOutStockOfActive = true
           }
-        },
-         // 查看活动详情
-        showDesc(row){
-          this.detailSn = row.promoRuleSn
-          this.openDetailModal = true
-        },
-        // 获取销售单参与的活动列表
-        pageInit(){
-          salesPromoQueryList({ salesBillSn: this.salesBillSn }).then(res => {
-            if(res.status == 200){
-              this.activeList = res.data || []
-            }
-            this.$nextTick(()=>{
-              this.searchTable()
-            })
-          })
-        },
-        async searchTable(){
-            this.dataSource = []
-            this.disabled = true
-            this.spinning = true
-            // 参数
-            const params = {
-                salesBillSn: this.salesBillSn,
-                showStock: this.showStock,
-                warehouseSn: this.warehouseSn,
-                promotionFlag: this.promoFlag == '' ? undefined : this.promoFlag
-            }
-            const active = this.activeList.filter(item => item.enabledFlag == 1)
-
-            // 正常产品
-            const hasSearchNormal = !params.promotionFlag || params.promotionFlag == 0
-            const proList = hasSearchNormal ? await salesDetailAllList(params).then(res => res.data) : []
-            const norTotal = hasSearchNormal ? await salesDetaiCount(params).then(res => res.data) : null
-            // 没有活动时,表格不显示统计数据
-            let listData = active.length ? (proList.length ? [{
-                id: 'promo-normal',
-                total: norTotal
-              },...proList] : []) : proList
-            
-            if(params.promotionFlag != 0){  
-              // 循环获取活动产品
-              for(let i=0;i<active.length;i++){
-                const promo = active[i]
-                const activeParams = {
-                  promoRuleSn: promo.promoRuleSn,
-                  promoSn: promo.promoSn,
-                  salesPromoSn: promo.salesPromoSn,
-                  ...params
-                }
-                
-                // 获取活动产品统计
-                const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
-                if(acTotal){
-                  // 采购额结余
-                  acTotal.cgejyAmount = (Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)).toFixed(2)
-                  // 采购额超出
-                  acTotal.cgeccAmount = (Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)).toFixed(2)
-                }
-                // 有数据时才调用接口,避免做无用的调用
-                if(acTotal&&acTotal.totalQty){
-                  // 获取活动产品列表
-                  const aclist = await salesDetailAllList(activeParams).then(res => res.data)
-                  
-                  const retList = aclist.length ? [{
-                    id: 'promo-'+i,
-                    promo: promo,
-                    total: acTotal
-                  },...aclist] : []
-                  // 将活动产品数据拼接
-                  listData = aclist&&aclist.length ? listData.concat(retList) : listData
-                }
-              }
-              console.log(listData)
-              // 如果活动没有任何产品,不显示统计一行
-              if(active.length){
-                const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
-                if(hasAcp && hasAcp.length==0){
-                  listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
-                }
-              }
-            }
-            console.log(listData)
-            this.dataSource = listData
-            
-            // 格式化数据
-            let f = 0
-            this.outStockStr = ''
-            let str = ''
-            this.dataSource.map((item,i) => {
-              if(item.id.indexOf('promo-')>=0){f = f - 1}
-              item.no = i + 1 + f
-              const productCode = (item.productEntity && item.productEntity.code) || (item.dealerProductEntity && item.dealerProductEntity.code)
-              const productName = (item.productEntity && item.productEntity.name) || (item.dealerProductEntity && item.dealerProductEntity.name)
-              const productOrigCode = (item.productEntity && item.productEntity.origCode) || (item.dealerProductEntity && item.dealerProductEntity.origCode)
-              const productOrigUnit = (item.productEntity && item.productEntity.unit) || (item.dealerProductEntity && item.dealerProductEntity.unit)
-              item.productCode = productCode || '--'
-              item.productName = productName || '--'
-              item.productOrigCode = productOrigCode == ' ' ? '--' : productOrigCode
-              item.productOrigUnit = productOrigUnit || '--'
-              item.epushedQty = Number(item.pushedQty) - Number(item.pushQty)
-              if (item.unpushedQty && (Number(item.stockQty) < Number(item.unpushedQty))) {
-                  str += item.productCode + '、'
-                  if(item.promotionFlag != 0){
-                    this.hasOutStockOfActive = true
-                  }
-              }
-            })
-            if (str.length > 0) {
-                str = str.substr(0, str.length - 1)
-                this.outStockStr = '产品编号为:' + str + '的产品库存不足;'
-            }
-            this.showEmpty = this.dataSource.length <= 0
-            this.tableHeight = (this.showEmpty ? 200 : this.maxHeight) + 'px'
-            this.spinning = false
-            this.disabled = false
-        },
+        }
+      })
+      if (str.length > 0) {
+        str = str.substr(0, str.length - 1)
+        this.outStockStr = '产品编号为:' + str + '的产品库存不足;'
       }
+      this.showEmpty = this.dataSource.length <= 0
+      this.tableHeight = (this.showEmpty ? 200 : this.maxHeight) + 'px'
+      this.spinning = false
+      this.disabled = false
     }
-  </script>
-  
+  }
+}
+</script>
+
   <style lang="less">
     .empty-data{
         color: #999;
@@ -407,11 +431,11 @@
         background: #f3f8fa;
       }
     }
-    .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-body-tr td.table-body-cell-no, 
+    .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-body-tr td.table-body-cell-no,
     .ve-table .ve-table-container .ve-table-content-wrapper table.ve-table-content tbody.ve-table-body tr.ve-table-expand-tr td.table-body-cell-no{
       padding: 0;
-    } 
+    }
     .ve-table .ve-table-container .ve-table-content-wrapper{
       border-bottom: 1px solid #ddd;
     }
-  </style>
+  </style>

+ 9 - 9
src/views/salesManagement/salesQueryNew/comps/importGuideModal.vue

@@ -80,11 +80,11 @@ export default {
       type: Boolean,
       default: false
     },
-    params: {
+    params: { // 参数
       type: Object,
       default: null
     },
-    promoProductClz:{
+    promoProductClz: { // 活动产品类型
       type: String,
       default: ''
     }
@@ -93,15 +93,15 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/sales/detail/importParse',
-      paramsData: null,
-      uploadParams: {
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/sales/detail/importParse', // 解析地址
+      paramsData: null, // 参数数据
+      uploadParams: { // 上传参数
         salesBillSn: this.params.salesBillSn,
-        salesPromoSn: this.params.salesPromoSn||'', 
-        promoProductClz: this.promoProductClz||''
+        salesPromoSn: this.params.salesPromoSn || '',
+        promoProductClz: this.promoProductClz || ''
       },
       exportLoading: false,
-      filePath: location.protocol + '//' + location.host + '/templ/销售导入产品模板.xlsx'
+      filePath: location.protocol + '//' + location.host + '/templ/销售导入产品模板.xlsx' // 模板文件地址
     }
   },
   methods: {
@@ -146,7 +146,7 @@ export default {
         this.$emit('close')
         this.paramsData = null
         this.$refs.importUpload.setFileList('')
-      }else{
+      } else {
         this.uploadParams.promoProductClz = this.promoProductClz
       }
     }

+ 45 - 32
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -81,7 +81,7 @@
             type="link"
             class="button-info"
             @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
-
+          <!-- // 操作按钮 -->
           <a-dropdown>
             <a-menu slot="overlay" @click="handleMenuClick">
               <a-menu-item key="3" :disabled="disablePromo">
@@ -102,7 +102,7 @@
               class="button-info"
             > 批量操作 <a-icon type="down" /> </a-button>
           </a-dropdown>
-
+          <!-- 导入操作 -->
           <a-dropdown :disabled="disablePromo">
             <a-menu slot="overlay" @click="handleImportClick">
               <a-menu-item key="GATE" v-if="promo&&promo.promotionRule&&promo.promotionRule.gateFlag==='1'">
@@ -292,18 +292,20 @@ import {
   updateWarehouse,
   salesBatchInsert
 } from '@/api/salesDetailNew'
+
 export default {
   name: 'ProductList',
   mixins: [commonMixin],
   components: {
     STable,
     VSelect,
+    // 导入弹框组件
     ImportGuideModal,
     chooseWarehouse,
-    setWarehouse,
-    ProductBrand,
-    productTypeAll,
-    updateActiveModal
+    setWarehouse, // 设置仓库组件
+    ProductBrand, // 产品品牌组件
+    productTypeAll, // 产品分类组件
+    updateActiveModal// 更换活动弹框组件
   },
   props: {
     openModal: { //  弹框显示状态
@@ -311,22 +313,27 @@ export default {
       default: false
     },
     newLoading: Boolean,
+    // 详情数据
     detailData: {
       type: Object,
       default: function () { return null }
     },
+    // 活动规则数据
     promo: {
       type: Object,
       default: function () { return null }
     },
+    // 表格id
     id: {
       type: String,
       default: ''
     },
+    // 仓库sn
     warehouseSn: {
       type: String,
       default: ''
     },
+    // 销售单sn
     salesBillSn: {
       type: String,
       default: ''
@@ -370,37 +377,38 @@ export default {
           return data
         })
       },
-      showSearchBox: false,
-      showDescBox: false,
+      showSearchBox: false, // 是否显示筛选条件
+      showDescBox: false, // 收起展开规则详细
       openWarehouseModal: false, // 打开仓库设置
       openGuideModal: false, //  导入产品引导
-      delLoading: false,
-      chooseDisabled: false,
+      delLoading: false, // 删除logding
       disabled: false, //  查询、重置按钮是否可操作
       queryParam: {
-        warehouseSn: undefined,
-        productCode: '',
-        productName: '',
-        productBrandSn: undefined,
+        warehouseSn: undefined, // 仓库
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productBrandSn: undefined, // 产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
       },
-      productType: [],
-      rowSelectionInfo: null,
-      warehouseDataList: [],
-      openUpActiveModal: false,
-      descDetail: null,
+      productType: [], // 已选产品分类
+      rowSelectionInfo: null, // 已选产品数据
+      warehouseDataList: [], // 仓库列表数据
+      openUpActiveModal: false, // 更换促销活动弹框
+      descDetail: null, // 规则详细数据
       promoProductClz: null, // 活动产品分类
-      disablePromo: false,
-      countData: null,
-      warehouseTit: ''
+      disablePromo: false, // 是否禁用活动
+      countData: null, // 统计信息
+      warehouseTit: '' // 仓库设置唐卡标题
     }
   },
   computed: {
+    // 已选产品数量
     selectTotal () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
+    // 表格列
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -411,10 +419,10 @@ export default {
         { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' },
         { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '10%', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
+      // 售价权限
+      if (this.$hasPermissions('B_salesEdit_salesPrice')) {
         arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '6%', align: 'right', scopedSlots: { customRender: 'price' } })
         arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
         let idx = 0
@@ -434,17 +442,21 @@ export default {
     }
   },
   methods: {
+    // 仓库下拉列表筛选
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
+    // 仓库列表加载完成
     warehouseLoad (sn, list) {
       this.warehouseDataList = list
     },
+    // 显示查询条件
     showSearch () {
       this.showSearchBox = !this.showSearchBox
     },
+    // 显示规则详细
     showDesc (descDetail) {
       this.showDescBox = !this.showDescBox
       this.descDetail = descDetail
@@ -452,6 +464,7 @@ export default {
       this.descDetail.quotaAmount = Number(this.descDetail.quotaAmount).toFixed(2)
       this.$emit('showDesc', this.showDescBox)
     },
+    // 打开产品弹框
     openCpModal () {
       this.$emit('openCpModal', 1, this.id, this.countData)
     },
@@ -459,7 +472,7 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
-    //  产品分类  change
+    //  选择产品分类
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
@@ -467,7 +480,6 @@ export default {
     },
     // 禁用活动
     disableActive (flag) {
-      console.log(flag, '------')
       this.disablePromo = flag
     },
     // 统计
@@ -483,7 +495,7 @@ export default {
         }
       })
     },
-    //  重置
+    //  重置查询
     resetSearchForm (flag) {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
@@ -564,6 +576,7 @@ export default {
       }
       this.setWarehouseInfo(ajax_data)
     },
+    // 选择仓库确认
     chooseWarehouseOk (sn) {
       const _this = this
       const snArr = []
@@ -579,6 +592,7 @@ export default {
       }
       _this.setWarehouseInfo(ajax_data)
     },
+    // 更改仓库信息
     setWarehouseInfo (data) {
       const _this = this
       _this.spinning = true
@@ -593,6 +607,7 @@ export default {
         _this.spinning = false
       })
     },
+    // 更多操作下拉菜单
     handleMenuClick (e) {
       const _this = this
       if (e.key == 0) { // 仓库设置
@@ -620,7 +635,7 @@ export default {
       }, record)
       this.openUpActiveModal = true
     },
-    // 已选产品  blur
+    // 已选产品数量修改
     onCellBlur (val, record) {
       const _this = this
       //  光标移出,值发生改变再调用编辑接口
@@ -643,7 +658,6 @@ export default {
         record.qty = record.qtyBackups
       }
     },
-
     // 删除产品
     handleDel (row) {
       const _this = this
@@ -679,6 +693,7 @@ export default {
       // 更换活动
       this.$emit('upActive', this.promo, data, params)
     },
+    // 更换活动成功
     upAcitveSuccess () {
       this.spinning = false
       this.openUpActiveModal = false
@@ -686,7 +701,6 @@ export default {
     },
     // 添加产品
     insterProduct (row, promotionFlag, promoProductClz) {
-      console.log(row, promotionFlag, promoProductClz)
       // 防止多次添加产品
       if (this.isInster) { return }
       this.saveNewProduct(row, promotionFlag, promoProductClz)
@@ -696,7 +710,6 @@ export default {
       this.$message.loading('正在添加产品...', 1)
       this.isInster = true
       this.spinning = true
-      console.log(row)
       const params = {
         salesPromoSn: this.promo.salesPromoSn,
         promoRuleSn: this.promo.promoRuleSn,
@@ -739,6 +752,7 @@ export default {
       this.openGuideModal = true
       this.promoProductClz = e.key
     },
+    // 关闭导入弹框
     closeGuideModel () {
       this.openGuideModal = false
       this.promoProductClz = ''
@@ -755,7 +769,6 @@ export default {
         params.promoRuleSn = this.promo.promoRuleSn
         params.promoProductClz = this.promoProductClz
       }
-
       salesBatchInsert(params).then(res => {
         if (res.status == 200) {
           this.$message.success('产品导入成功', 2.5)

+ 39 - 27
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -212,19 +212,19 @@ export default {
       default: false
     },
     newLoading: Boolean,
-    detailData: {
+    detailData: { // 销售单详情
       type: Object,
       default: function () { return null }
     },
-    warehouseSn: {
+    warehouseSn: { // 仓库sn
       type: String,
       default: ''
     },
-    salesBillSn: {
+    salesBillSn: { // 销售单sn
       type: String,
       default: ''
     },
-    showTotal: {
+    showTotal: { // 是否显示总计
       type: Boolean,
       default: true
     }
@@ -244,6 +244,7 @@ export default {
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              // 存储变更前的数量和仓库
               data.list[i].qtyBackups = data.list[i].qty
               data.list[i].warehouseBackups = data.list[i].warehouseSn
             }
@@ -253,50 +254,51 @@ export default {
           return data
         })
       },
-      showSearch: false,
+      showSearch: false, // 收起展开搜索
       openWarehouseModal: false, // 打开仓库设置
       openGuideModal: false, //  导入产品引导
-      delLoading: false,
-      chooseDisabled: false,
+      delLoading: false, // 删除loading
       disabled: false, //  查询、重置按钮是否可操作
       queryParam: {
-        warehouseSn: undefined,
-        productCode: '',
-        productName: '',
-        productBrandSn: undefined,
+        warehouseSn: undefined, // 仓库
+        productCode: '', // 产品编码
+        productName: '', // 产品名称
+        productBrandSn: undefined, // 产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
       },
-      productType: [],
-      rowSelectionInfo: null,
-      warehouseDataList: [],
-      countData: null,
-      isInster: false,
-      warehouseTit: ''
+      productType: [], // 产品分类
+      rowSelectionInfo: null, // 已选的产品数据
+      warehouseDataList: [], // 仓库列表
+      countData: null, // 统计数据
+      isInster: false, // 是否添加
+      warehouseTit: '' // 仓库设置弹框标题
     }
   },
   computed: {
+    // 已选产品数量
     selectTotal () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
     },
+    // 表格高度
     tableHeight () {
       return window.innerHeight - 395
     },
+    // 表格列定义
     columns () {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '13%', align: 'center' },
         { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', align: 'left' },
-        // { title: '售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '8%', align: 'center' },
         { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '8%', align: 'center' },
         { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '15%', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
+      // 售价权限
+      if (this.$hasPermissions('B_salesEdit_salesPrice')) {
         arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
         arr.splice(8, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
@@ -305,11 +307,13 @@ export default {
     }
   },
   methods: {
+    // 仓库下拉列表筛选
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
+    // 仓库下拉列表数据加载完成
     warehouseLoad (sn, list) {
       this.warehouseDataList = list
     },
@@ -317,10 +321,11 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
+    // 打开产品列表弹框
     openCpModal () {
       this.$emit('openCpModal', 0, 'productNormalList')
     },
-    // 统计
+    // 获取统计
     getCount () {
       salesDetaiCount(Object.assign(this.queryParam, { showStock: true })).then(res => {
         if (res.status == 200) {
@@ -328,6 +333,7 @@ export default {
         }
       })
     },
+    // 删除全部已选产品
     handleBatchDelAll () {
       const _this = this
       if (_this.dataSource.length == 0) {
@@ -343,6 +349,7 @@ export default {
           deleteAll({ salesBillSn: _this.salesBillSn }).then(res => {
             if (res.status == 200) {
               _this.$refs.table.refresh(false)
+              // 触发事件给父级组件
               _this.$emit('insterOk', 'normal')
               _this.$message.success(res.message)
             }
@@ -374,6 +381,7 @@ export default {
           }).then(res => {
             if (res.status == 200) {
               _this.$refs.table.refresh(false)
+              // 触发事件给父级组件
               _this.$emit('insterOk', 'normal')
               _this.$message.success(res.message)
             }
@@ -382,7 +390,7 @@ export default {
         }
       })
     },
-    // 设置单个出库仓库
+    // 单个设置出库仓库
     handleWarehouseBox (row) {
       const snArr = [row.salesBillDetailSn]
       const ajax_data = {
@@ -392,6 +400,7 @@ export default {
       }
       this.setWarehouseInfo(ajax_data)
     },
+    // 选择仓库确认
     chooseWarehouseOk (sn) {
       const _this = this
       const snArr = []
@@ -406,6 +415,7 @@ export default {
       }
       _this.setWarehouseInfo(ajax_data)
     },
+    // 修改仓库
     setWarehouseInfo (data) {
       const _this = this
       _this.spinning = true
@@ -425,6 +435,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
+    // 操作下拉菜单
     handleMenuClick (e) {
       const _this = this
       if (e.key == 0) { // 仓库设置
@@ -444,7 +455,7 @@ export default {
         this.handleBatchDelAll()
       }
     },
-    // 已选产品  blur
+    // 已选产品 修改销售数量
     onCellBlur (val, record) {
       const _this = this
       //  光标移出,值发生改变再调用编辑接口
@@ -466,7 +477,7 @@ export default {
         record.qty = record.qtyBackups
       }
     },
-    // 重置
+    // 重置查询
     resetSearchForm (flag) {
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
@@ -504,7 +515,6 @@ export default {
     },
     // 添加产品
     insterProduct (row, promotionFlag) {
-      console.log(row, promotionFlag)
       // 防止多次添加产品
       if (this.isInster) { return }
       this.saveNewProduct(row, promotionFlag)
@@ -536,6 +546,7 @@ export default {
         if (res.status == 200) {
           this.$message.success('产品添加成功', 2.5)
           this.resetSearchForm(true)
+          // 触发事件给父级组件
           this.$emit('insterOk', 'normal')
         }
         this.spinning = false
@@ -545,20 +556,21 @@ export default {
         this.isInster = false
       })
     },
+    // 导入产品弹框关闭
     closeGuideModel () {
       this.openGuideModal = false
     },
-    // 批量导入产品
+    // 批量导入产品确认
     hanldeOk (data, salesPromoSn) {
       const params = {
         salesBillSn: this.detailData.salesBillSn,
         salesBillDetailList: data
       }
-
       salesBatchInsert(params).then(res => {
         if (res.status == 200) {
           this.$message.success('产品导入成功', 2.5)
           this.resetSearchForm(true)
+          // 触发事件给父级组件
           this.$emit('insterOk', 'normal')
         }
       })

+ 21 - 18
src/views/salesManagement/salesQueryNew/detail.vue

@@ -66,7 +66,7 @@
         </div>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
-        <!-- alert -->
+        <!-- 统计信息 -->
         <a-alert type="info" style="margin-bottom: 10px;">
           <div slot="message">
             <div>
@@ -257,26 +257,25 @@ export default {
     return {
       spinning: false,
       disabled: false,
-      showDsModal: false,
-      showStockOut: false,
+      showDsModal: false, // 一键审核弹框
+      showStockOut: false, // 缺货明细弹框
       authCode: '', // 权限码
       hasData: false, // 是否有数据
-      showDetail: false,
-      openModal: false,
+      showDetail: false, // 基础信息是否显示
+      openModal: false, // 打印导出弹框
       detailData: null, //  详情数据
-      nowType: null,
+      nowType: null, // 打印导出类型
       isCityPrice: false, //  是否显示市级价
-      visibleAudit: false,
-      auditInfo: null,
-      spinningAudit: false,
-      auditText: null,
-      fromRouter: null,
-      warehouseSn: undefined,
-      promoFlag: undefined
+      visibleAudit: false, // 审核弹框
+      spinningAudit: false, // 审核loading
+      auditText: null, // 审核备注信息
+      fromRouter: null, // 从那个页面打开当前页面
+      warehouseSn: undefined, // 所在仓库
+      promoFlag: undefined // 产品类型
     }
   },
   computed: {
-    // 地址
+    // 详细地址
     shippingAddress () {
       const shippingAddrProvinceName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrProvinceName ? this.detailData.salesBillExtEntity.shippingAddrProvinceName : ''
       const shippingAddrCityName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCityName ? this.detailData.salesBillExtEntity.shippingAddrCityName : ''
@@ -288,16 +287,20 @@ export default {
         return shippingAddrProvinceName + shippingAddrCityName + shippingAddrCountyName + shippingAddr
       }
     },
+    // 是否因此底部栏按钮
     hideFooter () {
       const detailData = this.detailData
       return detailData && (detailData.billStatus == 'HQ_CHANGE' || (detailData.salesBillSource != 'SALES' && detailData.billStatus == 'AUDIT_REJECT') || detailData.billStatus == 'FINISH' || detailData.billStatus == 'OUTING_WAREHOUSE')
     },
+    // 是否有促销活动产品
     hasPrompActive () {
       return this.detailData && this.detailData.promoFlag == 1
     },
+    // 是否有促销产品(转采购额)
     showConvertPromoGifts () {
       return this.$refs.productList && this.$refs.productList.showConvertPromoGifts
     },
+    // 表格高度计算
     pageHeight () {
       return window.innerHeight - 305 + (this.hideFooter ? 45 : 0)
     }
@@ -324,7 +327,7 @@ export default {
     searchTable () {
       this.$refs.productList.searchTable()
     },
-    //  详情
+    // 详情
     getDetail () {
       salesDetailBySn({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => {
         if (res.status == 200) {
@@ -334,7 +337,7 @@ export default {
         this.$refs.productList.pageInit()
       })
     },
-    // 打开缺货明细
+    // 打开缺货明细弹框
     openStockOut () {
       if (this.$refs.productList.outStockStr != '') {
         this.showStockOut = true
@@ -424,7 +427,7 @@ export default {
         }
       })
     },
-    // 打印导出
+    // 打印导出弹框
     handlePrint (type, authCode) {
       const _this = this
       _this.$store.state.app.curActionPermission = authCode
@@ -444,8 +447,8 @@ export default {
         this.openModal = true
       }
     },
+    // 关闭打印弹框
     closePrint () {
-      console.log(9)
       this.$store.state.app.curActionPermission = ''
       this.openModal = false
     },

File diff suppressed because it is too large
+ 478 - 477
src/views/salesManagement/salesQueryNew/detailAll.vue


+ 34 - 20
src/views/salesManagement/salesQueryNew/edit.vue

@@ -182,27 +182,30 @@ export default {
       spinning: false,
       activeList: [], // 活动列表
       newActiveList: [], // 新活动列表
-      activeDesKey: {},
+      activeDesKey: {}, // 活动规则详情数据
       salesBillSn: null, // 销售单sn
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
-      warehouseSn: undefined,
+      warehouseSn: undefined, // 仓库sn
+      // 有价格变更前后总金额
       updataData: {
         totalRealAmount: '',
         totalAmount: ''
       },
       priceUpdateModal: false, // 价格更新弹窗
-      showDetail: false,
-      showCpModal: false,
-      cpCurRefId: '',
-      disabledActiveOption: null,
-      yhDetail: null,
-      showNewActiveModal: false
+      showDetail: false, // 显示详细基本信息
+      showCpModal: false, // 添加产品弹框
+      cpCurRefId: '', // 当前操作的活动id
+      disabledActiveOption: null, // 禁用活动选项
+      yhDetail: null, // 优惠明细
+      showNewActiveModal: false // 新活动弹框
     }
   },
   computed: {
+    // 是否显示统计信息
     showTotal () {
       return this.activeList.length > 0
     },
+    // 详细地址
     shippingAddress () {
       const shippingAddrProvinceName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrProvinceName ? this.detailData.salesBillExtEntity.shippingAddrProvinceName : ''
       const shippingAddrCityName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCityName ? this.detailData.salesBillExtEntity.shippingAddrCityName : ''
@@ -220,6 +223,7 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
     },
+    // 收起展开活动区域
     tooglePanel (item) {
       item.isActive = !item.isActive
       this.activeList.splice()
@@ -252,7 +256,7 @@ export default {
         }
       })
     },
-    // 判断是否全部调用完
+    // 轮询判断是否全部加载完了
     isAllLoadFinish (mlist) {
       const nid = setInterval(() => {
         const ret = []
@@ -265,7 +269,6 @@ export default {
           clearInterval(nid)
           this.spinning = false
         }
-        console.log(ret)
       }, 50)
     },
     // 刷新所有表格数据
@@ -273,9 +276,10 @@ export default {
       const activeList = this.activeList.filter(item => item.isActive)
       const mlist = []
       this.spinning = true
-      // 加载正常产品列表
+      // 刷新正常产品列表
       this.$refs.productNormalList.resetSearchForm()
       mlist.push(this.$refs.productNormalList)
+
       // 刷新所有活动产品列表
       activeList.map(item => {
         const row = this.$refs['productList-' + item.promoRuleSn][0]
@@ -307,7 +311,7 @@ export default {
         this.updateAllTable()
       }, 500)
     },
-    // 获取是否有新活动
+    // 获取是否有新活动,有则弹出弹框
     async getNewActive () {
       const hasNewActive = await salesQueryUnPartPromo({ salesBillSn: this.$route.params.sn, enabledFlag: '1' }).then(res => res.data)
       if (hasNewActive.length) {
@@ -315,20 +319,18 @@ export default {
         this.showNewActiveModal = true
       }
     },
+    // 新活动弹框,确认
     showNewActiveOk () {
       this.showNewActiveModal = false
       this.getOrderDetail(true)
     },
-    // 添加产品,包括正常和活动的产品
+    // 添加产品后,关闭弹框
     closeProductModal (type) {
       this.cpCurRefId = ''
       this.showCpModal = false
-      // 刷新表格
-      // this.insterActiveOk(['normal','promo'][type])
     },
     // 打开选择产品弹框
     openProductModal (type, refId, countData) {
-      console.log(type, refId, countData)
       const promo = this.activeList.find(item => item.promoRuleSn == refId)
       if (promo) {
         promo.countData = countData
@@ -339,14 +341,15 @@ export default {
     },
     // 添加活动产品成功的回调
     insterActiveOk (type) {
-      console.log(type)
       const mlist = []
       this.spinning = true
+      // 如果时活动产品
       if (type == 'promo') {
         // 刷新正常产品列表
         this.$refs.productNormalList.resetSearchForm()
         mlist.push(this.$refs.productNormalList)
       }
+      // 如果时正常产品
       if (type == 'normal') {
         // 刷新活动产品列表
         const activeList = this.activeList.filter(item => item.isActive)
@@ -358,9 +361,10 @@ export default {
       }
       // 判断是否全部调用完
       this.isAllLoadFinish(mlist)
+      // 重新获取详情信息
       this.getOrderDetail()
     },
-    // 新增产品
+    // 单击新增产品
     insterProduct (row, promotionFlag, type) {
       // 正常产品
       if (type == 0) {
@@ -390,10 +394,12 @@ export default {
             nt && nt.resetSearchForm()
             mlist.push(nt)
           }
+
           // 刷新正常活动
           const pnt = this.$refs.productNormalList
           pnt && pnt.resetSearchForm()
           mlist.push(pnt)
+
           // 刷新当前活动
           const ot = this.$refs['productList-' + oldPromo.promoRuleSn][0]
           ot && ot.upAcitveSuccess()
@@ -407,7 +413,7 @@ export default {
         }
       })
     },
-    // 选择价格类型  并更新
+    // 价格变更,需要选择价格类型  并更新价格
     updatePrice (type) {
       const ajax_data = {
         salesBillSn: this.salesBillSn,
@@ -416,6 +422,7 @@ export default {
       if (type == 0) {
         this.submitResult(ajax_data)
       } else {
+        // 批量更新价格
         updateBatch(this.updataData.detailList).then(res => {
           this.priceUpdateModal = false
           if (res.status == 200) {
@@ -434,9 +441,11 @@ export default {
       if (this.detailData && this.detailData.salesBillSource == 'PURCHASE') {
         submitCheck({ salesBillSn: this.salesBillSn }).then(res => {
           if (res.status == 200) {
+            // 如果有价格变更记录
             if (res.data.detailList.length > 0) {
               this.updataData = res.data
               this.$nextTick(() => {
+                // 打开变更价格弹框
                 this.priceUpdateModal = true
               })
             } else {
@@ -453,7 +462,6 @@ export default {
       const _this = this
       // 校验活动规则
       const vaildActive = await salesPromoValidaSubmit({ salesBillSn: this.salesBillSn }).then(res => res.data)
-      // console.log(vaildActive)
       const a = vaildActive.filter(item => item.type == 1) // 不可提交
       const b = vaildActive.filter(item => item.type == 0) // 可跳过继续提交
       // 弹出不符合规则弹框,不可提交
@@ -500,6 +508,7 @@ export default {
         }
       }
     },
+    // 提交销售单
     async submitOrder (data) {
       this.spinning = true
       const res = await salesWriteSubmit(data)
@@ -517,6 +526,7 @@ export default {
       item.promotionRule.upperLimitAmount = item.promotion.upperLimitAmount ? Number(item.promotion.upperLimitAmount).toFixed(2) : ''
       row && row.showDesc(item.promotionRule)
     },
+    // 展开活动规则详情回调
     showDescOk (v, item) {
       item.showDesc = v
       if (!item.isActive) {
@@ -622,13 +632,17 @@ export default {
         }
       })
     },
+    // 选择禁用活动选项
     changeDaOpt (e) {
       this.disabledActiveOption = e.target.value
     },
+    // 页面初始化
     pageInit () {
       this.salesBillSn = this.$route.params.sn
       this.warehouseSn = this.$route.params.sn ? this.$route.params.wSn : ''
+      // 获取销售单详情
       this.getOrderDetail(true)
+      // 是否有新活动
       this.getNewActive()
     }
   },

+ 81 - 81
src/views/salesManagement/salesQueryNew/newPromoModal.vue

@@ -1,90 +1,90 @@
 <template>
-    <a-modal
-      v-model="opened"
-      title="新活动提醒"
-      centered
-      :maskClosable="false"
-      :confirmLoading="confirmLoading"
-      width="30%"
-      :footer="null"
-      @cancel="cancel"
-    >
-      <a-spin :spinning="spinning" tip="Loading...">
-        <div style="padding: 0 50px;">
-          <div style="padding:10px 0;text-align:left;">
-            系统发布新的促销活动,是否要参与?
-          </div>
-          <div style="text-align:left;color:#00aaff;">
-            <a-checkbox-group v-model="newPromoSnList">
-              <a-row v-for="item in newActiveList" :key="item.promotionSn">
-                <a-col :span="24"><a-checkbox :value="item.promotionSn">{{ item.description }}</a-checkbox></a-col>
-              </a-row>
-            </a-checkbox-group>
-          </div>
+  <a-modal
+    v-model="opened"
+    title="新活动提醒"
+    centered
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    width="30%"
+    :footer="null"
+    @cancel="cancel"
+  >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div style="padding: 0 50px;">
+        <div style="padding:10px 0;text-align:left;">
+          系统发布新的促销活动,是否要参与?
         </div>
-        <div style="margin-top:36px;text-align:center;">
-          <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>
+        <div style="text-align:left;color:#00aaff;">
+          <a-checkbox-group v-model="newPromoSnList">
+            <a-row v-for="item in newActiveList" :key="item.promotionSn">
+              <a-col :span="24"><a-checkbox :value="item.promotionSn">{{ item.description }}</a-checkbox></a-col>
+            </a-row>
+          </a-checkbox-group>
         </div>
-      </a-spin>
-    </a-modal>
-  </template>
-  
-  <script>
-  import { commonMixin } from '@/utils/mixin'
-  import { salesDetailAddPromo } from '@/api/salesDetailNew'
-  export default {
-    name: 'newPromoModal',
-    mixins: [commonMixin],
-    props: {
-      show: [Boolean],
-      newActiveList: [Array],
-      salesBillSn: [String]
-    },
-    data () {
-      return {
-        opened: this.show,
-        spinning: false,
-        newPromoSnList: [],
-        confirmLoading: false
-      }
-    },
-    methods: {
-      //  保存
-      handleSubmit () {
-        const _this = this
-        if(_this.newPromoSnList.length){
-            salesDetailAddPromo({
-              "salesBillSn": _this.salesBillSn,
-              "promoSnList": _this.newPromoSnList
-            }).then(res => {
-              if(res.status == 200){
-                _this.$emit('ok')
-              }
-            })
-          }else{
-            _this.$message.info("请选择要参与的新活动")
-            return true
+      </div>
+      <div style="margin-top:36px;text-align:center;">
+        <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>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { salesDetailAddPromo } from '@/api/salesDetailNew'
+export default {
+  name: 'NewPromoModal',
+  mixins: [commonMixin],
+  props: {
+    show: [Boolean],
+    newActiveList: [Array],
+    salesBillSn: [String]
+  },
+  data () {
+    return {
+      opened: this.show,
+      spinning: false,
+      newPromoSnList: [], // 新活动选项sn
+      confirmLoading: false
+    }
+  },
+  methods: {
+    //  保存
+    handleSubmit () {
+      const _this = this
+      if (_this.newPromoSnList.length) {
+        salesDetailAddPromo({
+          'salesBillSn': _this.salesBillSn,
+          'promoSnList': _this.newPromoSnList
+        }).then(res => {
+          if (res.status == 200) {
+            _this.$emit('ok')
           }
-      },
-      cancel () {
-        this.opened = false
-        this.$emit('cancel')
+        })
+      } else {
+        _this.$message.info('请选择要参与的新活动')
+        return true
       }
     },
-    watch: {
-      show (newValue, oldValue) {
-        this.opened = newValue
-        if (!newValue) {
-          this.newPromoSnList = []
-        }else{
-            // 默认全选
-            this.newActiveList.map(item => {
-               this.newPromoSnList.push(item.promotionSn)
-            })
-        }
+    // 取消
+    cancel () {
+      this.opened = false
+      this.$emit('cancel')
+    }
+  },
+  watch: {
+    show (newValue, oldValue) {
+      this.opened = newValue
+      if (!newValue) {
+        this.newPromoSnList = []
+      } else {
+        // 默认全选
+        this.newActiveList.map(item => {
+          this.newPromoSnList.push(item.promotionSn)
+        })
       }
     }
   }
-  </script>
-  
+}
+</script>

+ 16 - 9
src/views/salesManagement/salesQueryNew/printModal.vue

@@ -27,6 +27,7 @@
             </a-select-option>
           </a-select>
         </a-form-model-item>
+        <!-- 如果是销售导出 -->
         <a-form-model-item label="是否缺货产品" prop="dataScope" v-if="nowType=='export'">
           <a-radio-group v-model="form.dataScope">
             <a-radio value="all">全部</a-radio>
@@ -34,27 +35,28 @@
             <a-radio value="LESS" :disabled="isDisabled">缺货</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <!-- 销售分类打印 -->
         <a-form-model-item label="产品售价" prop="priceType" v-if="nowType=='SALES_BILL_TYPE'&&$hasPermissions('B_salesTypePrint_salesPrice')">
-          <!-- 销售分类打印 -->
           <a-radio-group v-model="form.priceType">
             <a-radio value="SALES_BILL_TYPE_COST">打印</a-radio>
             <a-radio value="SALES_BILL_TYPE">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <!-- 销售打印 -->
         <a-form-model-item label="产品售价" prop="priceType" v-if="nowType=='SALES_BILL'&&$hasPermissions('B_salesPrint_salesPrice')">
-          <!-- 销售打印 -->
           <a-radio-group v-model="form.priceType">
             <a-radio value="SALES_BILL_COST">打印</a-radio>
             <a-radio value="SALES_BILL">不打印</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <!-- 销售导出 -->
         <a-form-model-item label="产品售价" prop="priceType" v-if="nowType=='export'&&$hasPermissions('B_salesDetailExport_salesPrice')">
-          <!-- 销售导出 -->
           <a-radio-group v-model="form.priceType">
             <a-radio :value="form.dataScope == 'ENOUGH' ? 'SALES_BILL_COST_NOT_LACK':'SALES_BILL_COST'">导出</a-radio>
             <a-radio :value="form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK':'SALES_BILL'">不导出</a-radio>
           </a-radio-group>
         </a-form-model-item>
+        <!-- 销售分类打印 -->
         <a-form-model-item label="货位编号" prop="orderBy" v-if="nowType=='SALES_BILL_TYPE'">
           <a-radio-group v-model="form.orderBy">
             <a-radio value="sbd.STACK_PLACE_CODE ASC">打印(↑升序)</a-radio>
@@ -80,13 +82,13 @@ export default {
       type: Boolean,
       default: false
     },
-    itemData: {
+    itemData: { // 单据详情信息
       type: Object,
       default: () => {
         return null
       }
     },
-    nowType: {
+    nowType: { // 操作类型,打印、分类打印、导出
       type: String,
       default: ''
     }
@@ -94,12 +96,14 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      // 打印、导出选项
       form: {
         id: 'all',
         dataScope: 'all',
         priceType: undefined,
         orderBy: undefined
       },
+      // 选项校验
       rules: {
         id: [{ required: true, message: '请选择产品分类', trigger: 'change' }],
         dataScope: [{ required: true, message: '请选择是否缺货产品', trigger: 'change' }],
@@ -111,10 +115,11 @@ export default {
         wrapperCol: { span: 15 }
       },
       spinning: false,
-      typeList: []
+      typeList: [] // 产品分类
     }
   },
   computed: {
+    // 弹框标题
     modalTit () {
       let title = ''
       if (this.nowType == 'SALES_BILL') {
@@ -126,6 +131,7 @@ export default {
       }
       return title
     },
+    // 是否禁用
     isDisabled () {
       const states = ['WAIT_SUBMIT', 'WAIT_AUDIT', 'AUDIT_REJECT']
       return this.itemData && states.includes(this.itemData.billStatus)
@@ -159,7 +165,7 @@ export default {
               }
               _this.$emit('ok', obj)
             }
-          } else if (_this.nowType == 'SALES_BILL') {
+          } else if (_this.nowType == 'SALES_BILL') { // 销售打印
             // 销售打印无权限不打印
             if (!_this.$hasPermissions('B_salesPrint_salesPrice')) {
               _this.form.priceType = 'SALES_BILL'
@@ -170,7 +176,7 @@ export default {
               type: isPrint || 'preview'
             }
             _this.$emit('ok', obj)
-          } else if (_this.nowType == 'export') {
+          } else if (_this.nowType == 'export') { // 销售导出
             // 销售导出无权限不导出
             if (!_this.$hasPermissions('B_salesDetailExport_salesPrice')) {
               _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK' : 'SALES_BILL'
@@ -185,7 +191,6 @@ export default {
           }
           _this.isShow = false
         } else {
-          console.log('error submit!!')
           return false
         }
       })
@@ -211,6 +216,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        // 重置表单选项
         this.form = {
           id: 'all',
           dataScope: 'all',
@@ -219,6 +225,7 @@ export default {
         }
         this.$refs.ruleForm.resetFields()
       } else {
+        // 如果是分类打印
         if (this.nowType == 'SALES_BILL_TYPE') {
           this.getTypeData()
         }

+ 1 - 1
src/views/salesManagement/salesQueryNew/receivingAddress/chooseAddressModal.vue

@@ -91,7 +91,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: String || Number,
       default: ''
     }

+ 5 - 3
src/views/salesManagement/salesQueryNew/receivingAddress/editAddressModal.vue

@@ -88,7 +88,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: String || Number,
       default: ''
     }
@@ -97,11 +97,12 @@ export default {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      isEdit: false,
+      isEdit: false, // 是否编辑
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 18 }
       },
+      // 表单数据
       form: {
         consigneeName: '',
         consigneeTel: '',
@@ -113,6 +114,7 @@ export default {
         countyName: '',
         addr: ''
       },
+      // 表单规则
       rules: {
         consigneeName: [
           { required: true, message: '请输入收货人', trigger: 'change' }
@@ -155,7 +157,6 @@ export default {
             }
           })
         } else {
-          console.log('error submit!!')
           return false
         }
       })
@@ -253,6 +254,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        // 重置表单
         this.$refs.ruleForm.resetFields()
         this.addrCityList = []
         this.addrDistrictList = []

+ 4 - 2
src/views/salesManagement/salesQueryNew/setPriceModal.vue

@@ -39,10 +39,12 @@ export default {
   mixins: [commonMixin],
   props: {
     show: [Boolean],
+    // 变更前总金额
     totalRealAmount: {
       type: [String, Number],
       default: ''
     },
+    // 变更后总金额
     totalAmount: {
       type: [String, Number],
       default: ''
@@ -52,8 +54,8 @@ export default {
     return {
       opened: this.show,
       spinning: false,
-      priceVal: undefined,
-      confirmLoading: false,
+      priceVal: undefined, // 价格类型
+      confirmLoading: false, // 按钮loading
       radioStyle: {
         display: 'block',
         height: '30px',

+ 18 - 11
src/views/salesManagement/salesQueryNew/stockOutDetailModal.vue

@@ -7,6 +7,7 @@
     v-model="isShow"
     @cancel="isShow=false"
     width="70%">
+    <!-- 基本信息 -->
     <a-descriptions size="small" :column="2">
       <a-descriptions-item label="销售单号">
         {{ detailData&&detailData.salesBillNo || '--' }}
@@ -14,6 +15,7 @@
       </a-descriptions-item>
       <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
     </a-descriptions>
+    <!-- 列表 -->
     <a-spin :spinning="spinning" tip="Loading...">
       <s-table
         class="sTable fixPagination"
@@ -27,6 +29,7 @@
         :showPagination="false"
         :defaultLoadData="false"
         bordered>
+        <!-- 单号 -->
         <template slot="productCode" slot-scope="text, record">
           <span style="padding-right: 15px;">{{ text }}</span>
           <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
@@ -34,10 +37,11 @@
         </template>
         <!-- 销售价 -->
         <template slot="price" slot-scope="text, record">
-            {{ toThousands(text) }}
-            <span v-if="record.promotionFlag=='GIFT'||record.promotionFlag=='DISCOUNT'" title="原价">({{ toThousands(record.origPrice) }})</span>
+          {{ toThousands(text) }}
+          <span v-if="record.promotionFlag=='GIFT'||record.promotionFlag=='DISCOUNT'" title="原价">({{ toThousands(record.origPrice) }})</span>
         </template>
       </s-table>
+      <!-- 操作按钮 -->
       <div class="btn-cont" style="padding:20px 20px 0;text-align: center;">
         <a-button
           class="button-warning"
@@ -54,8 +58,8 @@
           :disabled="disabled"
           :loading="exportClassifyLoading"
           id="allocateBillList-export">分类导出Excel</a-button>
-          <a-button style="margin-left: 10px" @click="isShow=false">关闭</a-button>
-       </div>
+        <a-button style="margin-left: 10px" @click="isShow=false">关闭</a-button>
+      </div>
     </a-spin>
   </a-modal>
 </template>
@@ -70,15 +74,15 @@ export default {
   mixins: [commonMixin],
   components: { STable },
   props: {
-    openModal: {
+    openModal: { // 是否显示弹框
       type: Boolean,
       default: false
     },
-    salesBillSn: {
+    salesBillSn: { // 销售单号
       type: [Number, String],
       default: ''
     },
-    detailData: {
+    detailData: { // 详细信息
       type: Object,
       default: function () {
         return null
@@ -86,11 +90,11 @@ export default {
     }
   },
   data () {
-    const _this = this
     return {
       spinning: false,
       isShow: this.openModal,
       disabled: false,
+      // 导出loading
       exportLoading: false,
       exportClassifyLoading: false,
       // 加载数据方法 必须为 Promise 对象
@@ -115,7 +119,7 @@ export default {
       }
     }
   },
-  computed:{
+  computed: {
     columns () {
       const _this = this
       const arr = [
@@ -127,8 +131,8 @@ export default {
         { title: '销售数量', dataIndex: 'salesQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '缺货数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
-      
-      if (this.$hasPermissions('B_salesDetail_salesPrice')) { // 售价权限
+      // 售价权限
+      if (this.$hasPermissions('B_salesDetail_salesPrice')) {
         arr.splice(6, 0, { title: '销售价', dataIndex: 'price', width: '8%', align: 'right', scopedSlots: { customRender: 'price' } })
         arr.splice(7, 0, { title: '销售金额', dataIndex: 'salesAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.splice(8, 0, { title: '缺货金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
@@ -137,6 +141,7 @@ export default {
     }
   },
   methods: {
+    // 导出缺货产品
     handleExport () {
       const _this = this
       _this.exportLoading = true
@@ -148,6 +153,7 @@ export default {
         _this.disabled = false
       })
     },
+    // 缺货产品分类导出
     handleClassifyExport () {
       const _this = this
       _this.exportClassifyLoading = true
@@ -167,6 +173,7 @@ export default {
     isShow (nVal, oVal) {
       if (!nVal) {
         this.$emit('close')
+        // 清空表格
         this.$refs.table.clearTable()
       } else {
         this.$nextTick(() => {

Some files were not shown because too many files changed in this diff