chenrui 1 tahun lalu
induk
melakukan
e96d751964

+ 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

+ 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