Prechádzať zdrojové kódy

销售数据、线索数据调整

qymljy 2 rokov pred
rodič
commit
2cdfcf87fe

+ 19 - 4
src/views/salesData/components/accountBalanceDetail.vue

@@ -231,10 +231,25 @@ export default {
       this.param.content.dataid = dataid
       this.param.content.enddate = endDate
       const res = await this.$api.requested(this.param)
-      this.list = res.data
-      this.counts = res.data[0].counts
-      this.total = res.total
-      this.currentPage = res.data.pageNUmber
+      if (res.data.length === 1){
+        if (res.data[0].isEmpty == 1){
+          this.list = []
+          this.counts = []
+          this.total = 0
+          this.currentPage = 0
+        }else {
+          this.list = res.data
+          this.counts = res.data[0].counts
+          this.total = res.total
+          this.currentPage = res.pageNUmber
+        }
+      }else {
+        this.list = res.data
+        this.counts = res.data[0].counts
+        this.total = res.total
+        this.currentPage = res.pageNUmber
+      }
+
     },
     /*获取账号类型*/
     async getAccountType () {

+ 10 - 3
src/views/salesData/components/allSalesTemplate.vue

@@ -208,6 +208,13 @@ export default {
       this.title = '订单'
       this.param.content.pageNumber = 1
       this.param.content.pageSize = 50
+      if (this.param.content.type == 0){
+        this.person = this.param.content.dataid
+        this.depment = ''
+      }else {
+        this.depment = this.param.content.dataid
+        this.person = ''
+      }
       this.queryOptions()
       this.departmentrtment()
     },
@@ -226,7 +233,8 @@ export default {
       const res = await this.$api.requested(this.depmentParam)
       this.deplist = this.createMenu(res.data.dep)
       this.personnelList = res.data.hr
-      if (this.dataid){
+      this.listData()
+      /*if (this.dataid){
         this.depment = this.dataid
         this.param.content.dataid = this.dataid
         this.param.content.type = 1
@@ -238,8 +246,7 @@ export default {
         this.param.content.dataid = userid
         this.param.content.type = 0
         this.listData()
-      }
-
+      }*/
     },
     createMenu (array) {
       var that = this

+ 10 - 2
src/views/salesData/index.vue

@@ -125,6 +125,8 @@ export default {
       this.$refs.customerAccountBalanceAnalysis.$refs.departmentSalesperson.deplist = this.deplist
       this.$refs.customerAccountBalanceAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
       /*客户销售*/
+      this.$refs.customer.param.content.dataid = dataid
+      this.$refs.salesperson.param.content.dataid = dataid
       this.$refs.customer.listData(dataid)
       this.activeName = '客户销售'
       /*报价分析*/
@@ -196,9 +198,15 @@ export default {
       this.$refs.customerAccountBalanceAnalysis.$refs.departmentSalesperson.deplist = this.deplist
       this.$refs.customerAccountBalanceAnalysis.$refs.departmentSalesperson.personnelList = this.personnelList
       /*客户销售*/
+      this.$refs.customer.param.content.dataid = dataid
       this.$refs.customer.param.content.type = type
+      this.$refs.customer.param.content.pageNumber = 1
+      this.$refs.customer.param.content.pageSize = 10
       this.$refs.customer.listData(dataid)
+      this.$refs.salesperson.param.content.dataid = dataid
       this.$refs.salesperson.param.content.type = type
+      this.$refs.salesperson.param.content.pageNumber = 1
+      this.$refs.salesperson.param.content.pageSize = 10
       this.$refs.salesperson.listData(dataid)
       /*报价分析*/
       this.$refs.quotationAnalysis.param.content.type = type
@@ -330,9 +338,9 @@ export default {
     handleClick(tab, event) {
       console.log(this.activeName);
       if (this.activeName === '客户销售'){
-        this.$refs.customer.listData()
+        this.$refs.customer.listData(this.$refs.customer.param.content.dataid)
       }else {
-        this.$refs.salesperson.listData()
+        this.$refs.salesperson.listData(this.$refs.salesperson.param.content.dataid)
       }
 
     },

+ 1 - 1
src/views/salesData/modules/salespersonSales.vue

@@ -33,7 +33,7 @@ export default {
   },
   methods:{
     listData(val){
-      this.param.content.dataid = this.dataid || val
+      this.param.content.dataid = val  || this.dataid
       this.$refs.sales.listData()
     }
   },