qymljy 7 달 전
부모
커밋
aa2afdaea8

+ 11 - 6
src/views/salesData/components/departmentSalesperson.vue

@@ -2,9 +2,9 @@
   <div>
     <span class="search__label inline-16">{{$t('部门')}}:</span>
     <el-cascader :placeholder="$t('请选择')"  class="inline-16" ref="selectdep" size="small" v-model="depment" :options="deplist" :append-to-body="!isFull"  placement="bottom"
-                  :props="{emitPath:true,expandTrigger:'hover',checkStrictly:true,label:'label',value:'departmentid',children:'children'}"  @change="selectDep" ></el-cascader>
+                  :props="{emitPath:true,expandTrigger:'hover',checkStrictly:true,label:'label',value:'departmentid',children:'children'}"  @change="selectDep" clearable></el-cascader>
     <span class="search__label inline-16">{{$t('业务员')}}:</span>
-    <el-select  v-model="person" filterable :placeholder="$t('请选择')" size="small" class="inline-16"  @change="selectPerson"  :popper-append-to-body="!isFull">
+    <el-select  v-model="person" filterable :placeholder="$t('请选择')" size="small" class="inline-16" clearable @change="selectPerson"  :popper-append-to-body="!isFull">
       <el-option
           v-for="item in personnelList"
           :key="item.index"
@@ -18,7 +18,7 @@
 <script>
 export default {
   name: "departmentSalesperson",
-  props:['isFull','placement'],
+  props:['isFull','placement','isNewDep'],
   /*props:['dataid','deplist','personnelList'],*/
   data(){
     return {
@@ -26,6 +26,7 @@ export default {
       depmentid:'',
       deplist:[],
       person:'',
+      personId:'',
       personnelList:[],
     }
   },
@@ -37,9 +38,13 @@ export default {
       this.$emit('depSelect',this.depmentid)
     },
     selectPerson(val){
-      this.depment = ''
-      this.depmentid = val
-      this.$emit('personSelect',this.depmentid)
+      if (this.isNewDep){
+
+      }else {
+        this.depment = ''
+      }
+      this.personId = val
+      this.$emit('personSelect',this.personId)
     }
   },
   mounted() {

+ 16 - 8
src/views/salesData/components/salesTemplate.vue

@@ -27,7 +27,7 @@
       </div>
       <div class="div-inline" style="float: right">
         <div class="inline-16 mt-10">
-          <departmentSalesperson ref="departmentSalesperson" @depSelect="depSelect" @personSelect="personSelect" :isFull="isFull"></departmentSalesperson>
+          <departmentSalesperson ref="departmentSalesperson" @depSelect="depSelect" @personSelect="personSelect" :isFull="isFull" :isNewDep="true"></departmentSalesperson>
         </div>
         <div class="mt-10 inline-16">
           <p class="search__label">{{$t('状态')}}:</p>
@@ -155,8 +155,9 @@ export default {
     async listData(val){
       if (val == '状态'){
         this.$refs.departmentSalesperson.person = ''
-        this.param.content.dataid = this.param.content.type == 0 ? -1 : this.param.content.dataid
-        this.personData()
+        this.param.content.type = 1
+        this.param.content.dataid = this.$refs.departmentSalesperson.depmentid?this.$refs.departmentSalesperson.depmentid:-1
+        this.personData(this.$refs.departmentSalesperson.depmentid)
       }
       this.param.content.dateType = this.dateType
       const res = await this.$api.requested(this.param)
@@ -165,21 +166,28 @@ export default {
     /*选择部门*/
     depSelect(val){
       this.param.content.type = 1
-      this.param.content.dataid = val
+      this.param.content.dataid = val?val:-1
+      this.personData(this.param.content.dataid)
       this.listData()
     },
     /*选择业务员*/
     personSelect(val){
-      this.param.content.type = 0
-      this.param.content.dataid = val
+      if (val ||  this.$refs.departmentSalesperson.depmentid){
+        this.param.content.type = val?0:1
+        this.param.content.dataid = val?val:this.$refs.departmentSalesperson.depmentid
+      }else {
+        this.param.content.type = 1
+        this.param.content.dataid = -1
+      }
       this.listData()
     },
     /*获取新的业务员列表*/
-    async personData(){
+    async personData(depid){
       let param = {
         id: 20230620102004,
         content: {
-          isleave:this.param.content.where.isleave
+          isleave:this.param.content.where.isleave,
+          depid:depid
         },
       }
       const res = await this.$api.requested(param)

+ 20 - 12
src/views/salesData/modules/customerAccountBalanceAnalysis.vue

@@ -15,11 +15,11 @@
           <div style="display: flex;flex-wrap: wrap;align-items: center;">
             <div class="inline-16 mt-10">
               <label class="search__label">{{$t('部门')}}:</label>
-              <el-cascader  ref="selectdep" size="small" v-model="depment" :options="deplist" :append-to-body="!isFull" :props="{emitPath:true,expandTrigger:'hover',checkStrictly:true,label:'label',value:'departmentid',children:'children'}"  @change="depSelect" ></el-cascader>
+              <el-cascader  ref="selectdep" size="small" v-model="depment" clearable :options="deplist" :append-to-body="!isFull" :props="{emitPath:true,expandTrigger:'hover',checkStrictly:true,label:'label',value:'departmentid',children:'children'}"  @change="depSelect" ></el-cascader>
             </div>
             <div class="inline-16 mt-10">
               <label class="search__label">{{$t('业务员')}}:</label>
-              <el-select  v-model="person" filterable :placeholder="$t('请选择')" size="small"  @change="personSelect"  :popper-append-to-body="!isFull">
+              <el-select  v-model="person" filterable :placeholder="$t('请选择')" clearable size="small"  @change="personSelect"  :popper-append-to-body="!isFull">
                 <el-option
                     v-for="item in personnelList"
                     :key="item.index"
@@ -162,9 +162,11 @@ export default {
     },
     /*渲染图表*/
     async queryModel(val,isleave,leave){
+      console.log(val,this.depment)
       if (leave == '状态'){
         this.person = ''
-        this.param.content.dataid = this.param.content.type = 0 ? -1 : val
+        this.param.content.dataid = this.depment[this.depment.length -1]?this.depment[this.depment.length -1]:-1
+        this.param.content.type = 1
       }else {
         this.param.content.dataid = val ? val : this.dataid
       }
@@ -207,7 +209,7 @@ export default {
         }
       })
       this.chartCustomerLine.changeData([this.balance,this.tbzzl])
-      leave == '状态'?this.personData():''
+      leave == '状态'?this.personData(this.depment[this.depment.length -1]?this.depment[this.depment.length -1]:-1):''
     },
     renderPie(val){
       this.chartCustomerLine = new DualAxes('customerAccountBalanceAnalysisChart', {
@@ -288,23 +290,29 @@ export default {
       this.person = ''
       this.depment = val
       this.param.content.type = 1
-      this.param.content.dataid = val[val.length -1]
-      this.queryModel(val[val.length -1],this.param.content.where.isleave)
+      this.param.content.dataid = val[val.length - 1]?val[val.length - 1]:-1
+      this.personData(val[val.length - 1]?val[val.length - 1]:-1)
+      this.queryModel(this.param.content.dataid,this.param.content.where.isleave)
     },
     /*选择业务员*/
     personSelect(val){
-      this.depment = ''
+      if (this.person || this.depment[this.depment.length - 1]){
+        this.param.content.type = this.person? 0 : 1
+        this.param.content.dataid = this.person ? this.person : this.depment[this.depment.length - 1]
+      }else {
+        this.param.content.type = -1
+        this.param.content.dataid = ''
+      }
       this.person = val
-      this.param.content.type = 0
-      this.param.content.dataid = this.person
-      this.queryModel(val,this.param.content.where.isleave)
+      this.queryModel(this.param.content.dataid,this.param.content.where.isleave)
     },
     /*获取新的业务员列表*/
-    async personData(){
+    async personData(depid){
       let param = {
         id: 20230620102004,
         content: {
-          isleave:this.param.content.where.isleave
+          isleave:this.param.content.where.isleave,
+          depid:depid
         },
       }
       const res = await this.$api.requested(param)

+ 25 - 15
src/views/salesData/modules/quotationAnalysis.vue

@@ -16,7 +16,7 @@
           <div class="mt-10" style="min-width: 220px;">{{$t(`近12月报价次数趋势分析`)}}</div>
           <div class="in">
             <div class="inline-16 mt-10">
-              <departmentSalesperson ref="departmentSalesperson" class="inline-16" @depSelect="depSelect" @personSelect="personSelect" :isFull="isFull"></departmentSalesperson>
+              <departmentSalesperson ref="departmentSalesperson" class="inline-16" @depSelect="depSelect" @personSelect="personSelect" :isFull="isFull" :isNewDep="true"></departmentSalesperson>
             </div>
             <div class="mt-10 inline-16">
               <p class="search__label">{{$t('状态')}}:</p>
@@ -130,7 +130,8 @@ export default {
     async listData(val,type,state){
       if (state == '状态'){
         this.$refs.departmentSalesperson.person = ''
-        this.param.content.dataid = this.param.content.type == 0?-1:val
+        this.param.content.type = 1
+        this.param.content.dataid = this.$refs.departmentSalesperson.depmentid ? this.$refs.departmentSalesperson.depmentid : -1
       }else {
         this.param.content.dataid = val?val : this.dataid
       }
@@ -142,7 +143,7 @@ export default {
       this.totalamount = res.data.totalamount
       this.totalqty = res.data.totalqty
       this.cusamount = res.data.cusamount
-      state == '状态' ?this.personData():''
+      state == '状态' ?this.personData(this.$refs.departmentSalesperson.depmentid):''
     },
     /*获取报价分析数据*/
     async queryQuotation(val,type) {
@@ -207,26 +208,35 @@ export default {
     depSelect(val){
       this.plotParam.content.type = 1
       this.param.content.type = 1
-      this.plotParam.content.dataid = val
-      this.dataid = val
-      this.listData(val,this.plotParam.content.where.isleave)
-      this.queryQuotationModel(val,this.plotParam.content.where.isleave)
+      this.plotParam.content.dataid = val?val:-1
+      this.dataid = val?val:-1
+      this.listData(this.dataid,this.plotParam.content.where.isleave)
+      this.queryQuotationModel(this.dataid,this.plotParam.content.where.isleave)
+      this.personData(this.dataid)
     },
     /*选择业务员*/
     personSelect(val){
-      this.plotParam.content.type = 0
-      this.param.content.type = 0
-      this.plotParam.content.dataid = val
-      this.dataid = val
-      this.listData(val,this.plotParam.content.where.isleave)
-      this.queryQuotationModel(val,this.plotParam.content.where.isleave)
+      if (val || this.$refs.departmentSalesperson.depmentid){
+        this.plotParam.content.type = val?0:1
+        this.param.content.type = val?0:1
+        this.plotParam.content.dataid = val?val:this.$refs.departmentSalesperson.depmentid
+        this.dataid = val?val:this.$refs.departmentSalesperson.depmentid
+      }else {
+        this.plotParam.content.type = 1
+        this.param.content.type = 1
+        this.plotParam.content.dataid = -1
+        this.dataid = -1
+      }
+      this.listData(this.dataid,this.plotParam.content.where.isleave)
+      this.queryQuotationModel(this.dataid,this.plotParam.content.where.isleave)
     },
     /*获取新的业务员列表*/
-    async personData(){
+    async personData(depid){
       let param = {
         id: 20230620102004,
         content: {
-          isleave:this.plotParam.content.where.isleave
+          isleave:this.plotParam.content.where.isleave,
+          depid:depid
         },
       }
       const res = await this.$api.requested(param)