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

Merge branch 'master' of http://www.baoxianzhanggui.com:8090/sxzgd/vue-insagent-pc

lihongxiao 2 лет назад
Родитель
Сommit
0501cd9eae
3 измененных файлов с 197 добавлено и 26 удалено
  1. 17 1
      src/http/moudules/letter.js
  2. 126 9
      src/views/Letter/Letter.vue
  3. 54 16
      src/views/Letter/Orderlist.vue

+ 17 - 1
src/http/moudules/letter.js

@@ -301,11 +301,19 @@ export const getquote = () => {
 //订单列表
 export const queryOrders = (data) => {
     return axios({
-        url: "/insurance/order/queryOrders",
+        url: "/insurance/order/queryPageOrder",
         method: "post",
         data
     })
 }
+export const querySonOrders = (data) => {
+  return axios({
+      url: "/insurance/order/querySuborder",
+      method: "post",
+      data
+  })
+}
+
 //订单查询
 export const getByOrderNo = (data) => {
     return axios({
@@ -517,6 +525,14 @@ export const pythongetPolicyPrint=(data)=>{
         data
     })
 }
+//驾意险
+export const pythongetDriving=(data)=>{
+  return axios({
+      url:"/insurance/crawler/getDrivingInsurance",
+      method:"post",
+      data
+  })
+}
 
 //永城缴费状态查询
 export const orderStatusyongcheng = (id) => {

+ 126 - 9
src/views/Letter/Letter.vue

@@ -764,6 +764,51 @@
                 </div>
               </el-select>
             </div>
+            <template v-if="reslistitem.namesimple == '恒邦财险' && reslistitem.checked && reslistitem.agreementId">
+              <div class="flex f-c Driving-risk accident-style">
+                <h3>意外险信息</h3>
+                <el-table size="small" :data="hengbangInsuranceData" border v-loading="accidentLoading"
+                  @row-click="HBDrivingChange" ref="RsTable" highlight-current-row
+                  :header-cell-style="{ background: '#F2F7FC', fontWeight: '700', color: '#ee7000' }">
+                  <el-table-column align="center" width="40" label="选择">
+                       <template slot-scope="scope">
+                      <el-radio class="radio" v-model="templateSelection" :label="scope.row.programcode" @click.native.stop.prevent="HBDrivingRadio(scope.row)">&nbsp;</el-radio>
+                  </template>
+                  </el-table-column>
+                  <el-table-column prop="programname" label="方案名称" align="center"></el-table-column>
+                  <el-table-column prop="suminsured" label="保额" align="center"></el-table-column>
+                  <el-table-column prop="sumgrosspremium" label="保费 (元)/每份" align="center">
+                  </el-table-column>
+                  <el-table-column  label="份数" align="center">
+                    <template slot-scope="scope">
+                      <span>{{scope.row.quantity}}</span>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+            </template>
+            <template v-if="reslistitem.namesimple == '中国人寿' && reslistitem.checked && reslistitem.agreementId">
+              <div class="flex f-c Driving-risk accident-style">
+                <h3>意外险信息</h3>
+                <el-table size="small" :data="renshouInsuranceData" border v-loading="accidentLoading"
+                  @row-click="RSDrivingChange" ref="RsTable" highlight-current-row
+                  :header-cell-style="{ background: '#F2F7FC', fontWeight: '700', color: '#ee7000' }">
+                  <el-table-column align="center" width="55" label="选择">
+                       <template slot-scope="scope">
+                      <el-radio class="radio" v-model="templateSelection" :label="scope.row.id" @click.native.stop.prevent="RSDrivingRadio(scope.row)">&nbsp;</el-radio>
+                  </template>
+                  </el-table-column>
+                  <el-table-column prop="productName" label="方案名称" align="center"></el-table-column>
+                  <el-table-column prop="totalPremium" label="保费 (元)/每份" align="center">
+                  </el-table-column>
+                  <el-table-column  label="份数" align="center">
+                    <template slot-scope="scope">
+                      <span>{{scope.row.quantity}}</span>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+            </template>
             <template v-if="reslistitem.namesimple == '紫金财险' && reslistitem.checked && reslistitem.agreementId">
               <div class="flex f-c Driving-risk accident-style">
                 <h3>意外险信息</h3>
@@ -1783,6 +1828,7 @@ export default {
       }
     };
     return {
+      templateSelection:"",
       areaOption:yongchengData.data,
       iscCrownerShow:false,
       isApplicantShow:false,
@@ -1797,11 +1843,14 @@ export default {
       // selectedOptions1: [],
       // selectedOptions2: [],
       // selectedOptions3: [],
-      // ------------紫金意外险
-      ziJinInsuranceData: [],
-      accidentalDrivingVo: [],
-      zijinengageListData: [],
-      zijinengageList: [],
+      hengbangInsuranceData:[],//恒邦驾意险
+      hengbangaccidentalDrivingVo:[],//恒邦驾意险
+      renshouaccidentalDrivingVo:{},//人寿意外险
+      renshouInsuranceData: [],//-人寿意外险list
+      ziJinInsuranceData: [],//-紫金意外险list
+      accidentalDrivingVo: [],//-紫金意外险传参
+      zijinengageListData: [],//紫金特约
+      zijinengageList: [],//紫金特约
       // ------------紫金意外险
       licenseplate: true,
       accidentForm: {
@@ -3286,6 +3335,7 @@ export default {
     },
     //选择协议  val:协议id  row:协议列表  index:下标  item:保险公司数据集合
     agreementChange(val, row, index, item) {
+      console.log(val,row,index,item)
       let obj = {};
       obj = row.find(item => {
         return item;
@@ -3312,6 +3362,23 @@ export default {
             }
           });
           break;
+          case '中国人寿':
+          case '恒邦财险':
+          case '安盛天平':
+          case '众安财险':
+          this.$api.letter.pythongetDriving({ agreementId: val}).then(res => {
+            if (res.code == 200) {
+              let data = res.data;
+              data.map(ele => {
+                ele.quantity = 1;
+                return ele;
+              })
+              this[item.cnName+'InsuranceData'] = data;
+
+            }
+          });
+          break;
+
         default:
           break;
       }
@@ -3324,6 +3391,32 @@ export default {
         return val;
       })
     },
+    HBDrivingChange(row){
+      if(this.templateSelection==row.programcode){
+        this.templateSelection=null;
+        this.hengbangaccidentalDrivingVo={};
+      }else{
+        this.templateSelection=row.programcode;
+        this.hengbangaccidentalDrivingVo=row;
+      }
+
+    },
+    RSDrivingChange(row){
+      if(this.templateSelection==row.id){
+        this.templateSelection=null;
+        this.renshouaccidentalDrivingVo={};
+      }else{
+        this.templateSelection=row.id;
+        this.renshouaccidentalDrivingVo=row;
+      }
+
+    },
+    RSDrivingRadio(row){
+      this.RSDrivingChange(row)
+    },
+    HBDrivingRadio(row){
+      this.HBDrivingChange(row)
+    },
     zijinengageChange(select, row) {
       this.zijinengageList = [];
       select.map(val => {
@@ -3338,7 +3431,8 @@ export default {
     },
     //勾选保险公司
     initchange(e, code, name, index) {
-      let ins = this.totalCompanyList[index].namesimple;
+      if(e){
+        let ins = this.totalCompanyList[index].namesimple;
       this.totalCompanyList[index].agreementId = "";
       this.totalCompanyList[index].checked = e;
       this.totalCompanyList[index].agreementId = this.totalCompanyList[index].agreement[0].id;
@@ -3366,9 +3460,29 @@ export default {
             }
           });
           break;
+          case '中国人寿':
+          case '恒邦财险':
+          case '安盛天平':
+          case '众安财险':
+          this.$api.letter.pythongetDriving({ agreementId: this.totalCompanyList[index].agreement[0].id}).then(res => {
+            if (res.code == 200) {
+              let data = res.data;
+              data.map(ele => {
+                ele.quantity = 1;
+                return ele;
+              })
+              this[name+"InsuranceData"] = data;
+
+            }
+          });
+          break;
         default:
           break;
       }
+      }else{
+
+      }
+
     },
     clearAccidentForm() {
       this.accidentForm = {
@@ -4149,8 +4263,11 @@ export default {
 
     // 爬虫对接
     quoteInsurance(num, id, namesimple, apiType) {
+      console.log(this.totalCompanyList[num])
       let api = apiType == 2 ? "pythonquote" : "anshengquote";
+      let ccidenttype=this.totalCompanyList[num].cnName;
       let params = {
+        accidentalDrivingVo:this[ccidenttype+'accidentalDrivingVo'],
         orderNo: this.orderno,
         companyId: id,
         agreementId: this.totalCompanyList[num].agreementId,
@@ -4374,9 +4491,9 @@ export default {
                   title: '通融单',
                   duration: 0,
                   dangerouslyUseHTMLString: true,
-                  message: `<div> ${ 
-                    res.data.warnMessageList.map(item=>{ 
-                        return `<p>${ 
+                  message: `<div> ${
+                    res.data.warnMessageList.map(item=>{
+                        return `<p>${
                       item}</p>`
                     }).join('')}
                     </div>`

+ 54 - 16
src/views/Letter/Orderlist.vue

@@ -5,7 +5,7 @@
       <el-row>
         <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
           <el-form-item label="订单号">
-            <el-input v-model="pageRequest.orderNo" placeholder="请输入车牌号" class="widths" clearable></el-input>
+            <el-input v-model="pageRequest.orderNo" placeholder="请输入订单号" class="widths" clearable></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
@@ -57,17 +57,19 @@
       </el-row>
     </el-form>
     <el-table size="small" :data="pageResult" height="590" border v-loading="loading" highlight-current-row stripe
-      @row-click="handleRowClick" ref="expandTable" :row-class-name="getRowClass"
+       @expand-change="handleRowChange" ref="expandTable"
       :header-cell-style="{ background: '#F2F7FC', fontWeight: '700', color: '#606266' }">
       <el-table-column type="expand">
         <template slot-scope="scope">
           <div class="demo-table-expand flex a-c  j-s" :style="{ width: width, flexWrap: 'wrap' }"
             v-for="(item, index) in scope.row.insAreaCompanyList" :key="index">
-            <div style="width: 70px;">{{ item.inscompany }}</div>
+            <div style="width: 200px;">{{ item.inscompany }} <span style="color:#ee7000;">({{item.agreementName}})</span> </div>
             <div class="flex a-c j-s demo-table-expand-time">
               <div>总价: <span style="color:#ee7000;">{{ item.sumpremium }}</span></div>
               <div>交强险:<span style="color:#ee7000;">{{ item.jqpremium }}</span> </div>
               <div>商业险:<span style="color:#ee7000;">{{ item.sypremium }}</span></div>
+              <div>车船税:<span style="color:#ee7000;">{{ item.taxamount }}</span></div>
+              <div v-if="item.jypremium">驾意险:<span style="color:#ee7000;">{{ item.jypremium }}</span></div>
               <div>{{ item.createtime }}</div>
             </div>
             <div slot="reference" class="name-wrapper flex a-c j-c" style="margin:0 20px; width: 100px;">
@@ -253,7 +255,7 @@
             }}
           </el-descriptions-item>
           <el-descriptions-item label="商业深度定价分档">{{ orderInfo.extendInfo.deepPriceGradeBI }}</el-descriptions-item>
-          
+
         </el-descriptions>
       </div>
       <div class="Enclosure" v-if="orderInfo">
@@ -1397,6 +1399,7 @@ export default {
       expands: [],
       institutionOptions: [],
       width: document.documentElement.clientWidth,
+      insAreaCompanyList:[],//子订单list
     }
   },
   created() {
@@ -1466,13 +1469,7 @@ export default {
     getDimensions() {
       this.width = document.documentElement.clientWidth - 350 + 'px';
     },
-    //表格行点击下拉事件
-    handleRowClick(row) {
-      if (row.insAreaCompanyList.length > 0) {
-        row.expanded = !row.expanded;
-        this.$refs.expandTable.toggleRowExpansion(row, row.expanded);
-      }
-    },
+
     //订单修改
     CloseEdit(index, row) {
       this.$api.letter.getByOrderNo({ orderNo: row.orderno }).then((res) => {
@@ -1758,7 +1755,7 @@ export default {
                           fileurl: path,
                         });
                       }
-                      
+
                     });
                   }
                 });
@@ -1777,7 +1774,7 @@ export default {
                           fileurl: path,
                         });
                       }
-                     
+
                     });
                   }
                 });
@@ -1798,7 +1795,7 @@ export default {
                           fileurl: path,
                         });
                       }
-                      
+
                     });
                   }
                 });
@@ -1977,7 +1974,6 @@ export default {
                 })
               }
               if (this.orderInfo.crossInsurance.length > 0) {
-                console.log(1)
                 this.orderInfo.crossInsurance.map(ele => {
                   this.$api.letter.zijingetPolicyPrint({
                     companyId: item.id,
@@ -2131,6 +2127,49 @@ export default {
       }
       s.childNodes[0].classList.add("active");
     },
+    // //表格行点击下拉事件
+    // handleRowClick(row) {
+    //   if(!row.expanded){
+    //     this.$api.letter.querySonOrders({orderNo:row.orderno}).then(res=>{
+    //     if(res.code=='200' && res.data.length!=0){
+    //       this.pageResult.map(item=>{
+    //         if(item.orderno===row.orderno){
+    //           item.insAreaCompanyList=res.data;
+    //         }
+    //         return item;
+    //       })
+    //         row.expanded = !row.expanded;
+    //         this.$refs.expandTable.toggleRowExpansion(row, row.expanded);
+    //     }else{
+    //       this.$message.info("暂无数据");
+    //     }
+    //   })
+    //   }else{
+    //     row.expanded = !row.expanded;
+    //         this.$refs.expandTable.toggleRowExpansion(row, row.expanded);
+    //   }
+    // },
+    handleRowChange(row){
+      if(!row.expanded){
+        this.$api.letter.querySonOrders({orderNo:row.orderno}).then(res=>{
+        if(res.code=='200' && res.data.length!=0){
+          this.pageResult.map(item=>{
+            if(item.orderno===row.orderno){
+              item.insAreaCompanyList=res.data;
+            }
+            return item;
+          })
+            row.expanded = !row.expanded;
+            this.$refs.expandTable.toggleRowExpansion(row, row.expanded);
+        }else{
+          this.$message.info("暂无数据");
+        }
+      })
+      }else{
+        row.expanded = !row.expanded;
+            this.$refs.expandTable.toggleRowExpansion(row, row.expanded);
+      }
+    },
     //数据
     findPage() {
       this.loading = true;
@@ -2156,7 +2195,6 @@ export default {
     },
     //时间js
     monthChange(e) {
-      console.log(e)
       if (e === null) {
         this.pageRequest.startDate = e;
         this.pageRequest.endDate = e;