Просмотр исходного кода

出单量及费用统计 报表调整

li.pengfei 2 лет назад
Родитель
Сommit
990003bda9

+ 8 - 0
src/http/moudules/report.js

@@ -43,3 +43,11 @@ export const exportOrderAndCostData = (data) => {
     data
   })
 }
+//报表-出单量及费用统计-清单导出
+export const exportOrderAndCostListData = (data) => {
+  return axios({
+    url: "/report/exportOrderAndCostListData",
+    method: "post",
+    data
+  })
+}

+ 66 - 12
src/views/Report/StatisticalReport/OrderVolumeAndCostStatistics.vue

@@ -55,18 +55,33 @@
     </div>
 
     <!-- 数据列表显示区域 -->
-    <el-table size="mini" border stripe :data="dataList" :height="clientHeight" v-loading="loading"
+    <el-table size="mini" border stripe :data="dataList" :height="clientHeight" v-loading="loading" :stripe="true"
               :header-cell-style="{background:'#F2F7FC',fontWeight: '700',color:'#606266',textAlign: 'center'}"
               :cell-style="{textAlign: 'center'}" style="width: 100%;margin-bottom: 60px;">
-      <el-table-column prop="institution" fixed  label="机构名称" width="150"></el-table-column>
-      <el-table-column prop="deptname"  fixed label="团队名称" width="70"></el-table-column>
-      <el-table-column prop="username" fixed  label="业务员名称" width="90"></el-table-column>
-      <el-table-column prop="riskName"  label="产品" width="90"></el-table-column>
-      <el-table-column prop="policyCount"  label="保单数量" width="150"></el-table-column>
-      <el-table-column prop="sumpremium"  label="总保费" width="90"></el-table-column>
-      <el-table-column prop="superviseCostsPremiums"  label="总手续费" width="150"></el-table-column>
-      <el-table-column prop="otherCostsPremiums"  label="总跟单费" width="150"></el-table-column>
-      <el-table-column prop="sumCostsPremiums"  label="费用合计" width="150"></el-table-column>
+      <el-table-column  fixed  label="机构名称" width="180">
+        <template slot-scope="scope">
+            <i class="el-icon-paperclip"></i>
+            <span style="margin-left: 10px" @click="drillingData(scope.row,'jg')">{{ scope.row.institution }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column   fixed label="团队名称" width="180">
+        <template slot-scope="scope">
+          <i class="el-icon-paperclip" v-if="scope.row.deptname"></i>
+          <span style="margin-left: 10px" @click="drillingData(scope.row,'td')">{{ scope.row.deptname }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="username" fixed  label="业务员名称" width="180"></el-table-column>
+      <el-table-column prop="riskName"  label="产品" width="100"></el-table-column>
+      <el-table-column prop="policyCount"  label="保单数量" width="100"></el-table-column>
+      <el-table-column prop="sumpremium"  label="总保费" width="100"></el-table-column>
+      <el-table-column prop="superviseCostsPremiums"  label="总手续费" width="100"></el-table-column>
+      <el-table-column prop="otherCostsPremiums"  label="总跟单费" width="100"></el-table-column>
+      <el-table-column prop="sumCostsPremiums"  label="费用合计" width="100"></el-table-column>
+      <el-table-column   fixed="right" label="操作" width="180">
+        <template slot-scope="scope">
+           <el-button type="primary" size="small" @click="exportListExcel(scope.row)">本行清单导出</el-button>
+        </template>
+      </el-table-column>
     </el-table>
     <!-- 底部分页 -->
     <div class="bottomFixed">
@@ -112,6 +127,7 @@
           quoteEndDate: "",
           pageNum: 1,
           pageSize: 10,
+          isDrilling:"0",//是否下钻查询
         },
         dataList: [],//查询结果数据
       };
@@ -136,6 +152,22 @@
       };
     },
     methods: {
+      // 按照查询条件查询
+      drillingData(obj,type) {
+        this.queryForm.pageNum = 1;
+        this.queryForm.pageSize = 10;
+        this.queryForm.isDrilling="1";
+        this.queryForm.userId="";
+        this.queryForm.teamCode="";
+        this.queryForm.deptId="";
+        if(type=='jg'){
+          this.queryForm.deptId=obj.institutionId;
+        }else if(type='td'){
+          this.queryForm.deptId=obj.institutionId;
+          this.queryForm.teamCode=obj.deptId;
+        }
+        this.findPage();
+      },
       cleanTeamCode(){
         //级联清空 业务员
         this.queryForm.userId='';
@@ -203,6 +235,7 @@
         }
         this.queryForm.pageNum = 1;
         this.queryForm.pageSize = 10;
+        this.queryForm.isDrilling="0";
         this.findPage();
       },
       //数据
@@ -245,7 +278,7 @@
           this.$message.error('签单日期必须录入!')
           return
         }
-        this.$api.report.queryOrderAndCostData(this.queryForm).then(res=>{
+        this.$api.report.exportOrderAndCostData(this.queryForm).then(res=>{
           let url = process.env.BASE_URL+'/upload/'+res.data // 3.创建一个临时的url指向blob对象
           // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
           let a = document.createElement("a");
@@ -255,8 +288,29 @@
           // 5.释放这个临时的对象url
           window.URL.revokeObjectURL(url);
         })
-      }
+      },
 
+      //清单导出
+      exportListExcel(obj){
+        let  queryListForm={}
+        queryListForm.quoteStartDate=this.queryForm.quoteStartDate;
+        queryListForm.quoteEndDate=this.queryForm.quoteEndDate;
+        queryListForm.insCompany=this.queryForm.insCompany;
+        queryListForm.riskCode=obj.riskName=='交强险'?"BZ":"BUS";
+        queryListForm.deptId=obj.institutionId;
+        queryListForm.teamCode=obj.deptId;
+        queryListForm.userId=obj.userId;
+        this.$api.report.exportOrderAndCostListData(queryListForm).then(res=>{
+          let url = process.env.BASE_URL+'/upload/'+res.data // 3.创建一个临时的url指向blob对象
+          // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
+          let a = document.createElement("a");
+          a.href = url;
+          a.download = "出单量及费用统计报表-清单.xlsx";
+          a.click();
+          // 5.释放这个临时的对象url
+          window.URL.revokeObjectURL(url);
+        })
+      }
     }
   }
 </script>