Parcourir la source

费用校验-审核订单时 添加 调整费用比例功能

li.pengfei il y a 2 ans
Parent
commit
37ca9dd6d1

+ 114 - 13
src/views/FinancialManagement/CarInsurance/Verifytasks/Verifyuntasks.vue

@@ -34,7 +34,7 @@
         <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
           <el-form-item label="订单状态">
             <el-select v-model="pageRequest.orderStatus" disabled class="widths" clearable>
-              <el-option v-for="val in optionsStatus" :key='val.dictValue' :label="val.dictTag" :value="val.dictValue" ></el-option>
+              <el-option v-for="val in optionsStatus" :key='val.dictValue' :label="val.dictTag" v-model="val.dictValue" ></el-option>
               <!-- <el-option label="未审核" value="0"></el-option>
               <el-option label="审核通过" value="1"></el-option> -->
             </el-select>
@@ -51,7 +51,7 @@
         <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
           <el-form-item label="保险公司">
             <el-select v-model="pageRequest.companyId" filterable  class="widths" clearable>
-              <el-option v-for="val in companyList" :key='val.id' :label="val.name" :value="val.id" ></el-option>
+              <el-option v-for="val in companyList" :key='val.id' :label="val.name" v-model="val.id" ></el-option>
             </el-select>
 
           </el-form-item>
@@ -91,7 +91,7 @@
       <el-table-column prop="createtime" label="录单日期" align="center" width="200"></el-table-column>
       <el-table-column label="操作" align="center" min-width="100" fixed="right">
         <template slot-scope="scope">
-          <el-button size="mini" type="text" @click="OrderDetails(scope.row, item)">审核
+          <el-button size="mini" type="text" @click="OrderDetails(scope.row)">审核
           </el-button>
         </template>
       </el-table-column>
@@ -103,7 +103,7 @@
         layout="total, sizes, prev, pager, next, jumper" :total="totalSize"></el-pagination>
     </div>
     <!-- 车辆报价新页面 -->
-    <el-dialog title="报价详情" :visible.sync="quotedetailsdialogVisible" width="90%">
+    <el-dialog title="报价详情" :visible.sync="quotedetailsdialogVisible" width="90%" @close="closeDialog">
       <div class="Enclosure" v-if="orderInfo">
         <div class="home flex j-s a-c back">
           <div class="flex j-s a-c color">
@@ -343,12 +343,48 @@
           <el-table :data="feeDetailInfo"   :border="true"   width="100%"  :stripe="true" size="mini">
             <el-table-column prop="feeTypeName" label="费用类型" width="10%"></el-table-column>
             <el-table-column  label="交强险费用跟单明细" width="30%">
-              <el-table-column prop="jqFeeRateAll" label="手续费比例/跟单费比例/总比例" width="15%"></el-table-column>
-              <el-table-column prop="jqFeeAmountAll" label="手续费金额/跟单费金额/总金额" width="15%"></el-table-column>
+              <el-table-column prop="jqFeeRateAll" label="手续费比例/跟单费比例/总比例" width="15%">
+                <template slot-scope="scope">
+                  <div v-if="adjustFeeFlag&&scope.$index==0&&adjustFeeDescInfo.jqPremium&&adjustFeeDescInfo.jqPremium !=''">
+                    {{adjustFeeDescInfo.jqCommissionRate}}/
+                    <el-input-number class="feeadjust-input" @change="changeJqFeeRate" :controls="false" :precision="2" :step="0.01" :max="100-adjustFeeDescInfo.jqCommissionRate" :min="0" v-model="adjustFeeDescInfo.jqOtherFeeRate"></el-input-number>/
+                    {{adjustFeeDescInfo.jqAllFeeRate}}
+                  </div>
+                  <div v-if="!adjustFeeFlag&&scope.$index==0">{{scope.row.jqFeeRateAll}}</div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="jqFeeAmountAll" label="手续费金额/跟单费金额/总金额" width="15%">
+                <template slot-scope="scope">
+                  <div v-if="adjustFeeFlag&&scope.$index==0&&adjustFeeDescInfo.jqPremium&&adjustFeeDescInfo.jqPremium !=''">
+                    {{adjustFeeDescInfo.jqCommissionAmount}}元/
+                    {{adjustFeeDescInfo.jqOtherFeeAmount}}元/
+                    {{adjustFeeDescInfo.jqAllFeeAmount}}元
+                  </div>
+                  <div v-if="!adjustFeeFlag&&scope.$index==0">{{scope.row.jqFeeAmountAll}}</div>
+                </template>
+              </el-table-column>
             </el-table-column>
             <el-table-column  label="商业险费用跟单明细" width="30%">
-              <el-table-column prop="syFeeRateAll" label="手续费比例/跟单费比例/总比例" width="15%"></el-table-column>
-              <el-table-column prop="syFeeAmountAll" label="手续费金额/跟单费金额/总金额" width="15%"></el-table-column>
+              <el-table-column prop="syFeeRateAll" label="手续费比例/跟单费比例/总比例" width="15%">
+                <template slot-scope="scope">
+                  <div v-if="adjustFeeFlag&&adjustFeeDescInfo.syPremium&&adjustFeeDescInfo.syPremium!=''&&scope.$index==0">
+                    {{adjustFeeDescInfo.syCommissionRate}}/
+                    <el-input-number class="feeadjust-input" @change="changeSyFeeRate"  :controls="false" :precision="2" :step="0.01" :max="100-adjustFeeDescInfo.syCommissionRate" :min="0" v-model="adjustFeeDescInfo.syOtherFeeRate"></el-input-number>/
+                    {{adjustFeeDescInfo.syAllFeeRate}}
+                  </div>
+                  <div v-if="!adjustFeeFlag&&scope.$index==0">{{scope.row.syFeeRateAll}}</div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="syFeeAmountAll" label="手续费金额/跟单费金额/总金额" width="15%">
+                <template slot-scope="scope">
+                  <div v-if="adjustFeeFlag&&adjustFeeDescInfo.syPremium&&adjustFeeDescInfo.syPremium!=''&&scope.$index==0">
+                    {{adjustFeeDescInfo.syCommissionAmount}}元/
+                    {{adjustFeeDescInfo.syOtherFeeAmount}}元/
+                    {{adjustFeeDescInfo.syAllFeeAmount}}元
+                  </div>
+                  <div v-if="!adjustFeeFlag&&scope.$index==0">{{scope.row.syFeeAmountAll}}</div>
+                </template>
+              </el-table-column>
             </el-table-column>
             <el-table-column   label="非车险费用跟单明细" width="30%">
               <el-table-column prop="fcFeeRate" label="比例" width="15%"></el-table-column>
@@ -358,6 +394,7 @@
         </div>
       </div>
       <span slot="footer" class="dialog-footer" style="display: flex; justify-content: center;align-items: center;">
+        <el-button size="small" type="primary" style="background-color: #0EC216; border: 1px solid #0EC216;margin-right: 30px;" @click="adjustFee"><span v-if="adjustFeeFlag">取消调整</span><span v-if="!adjustFeeFlag">调整费用</span></el-button>
         <el-button size="small" type="primary" style="background-color: #0EC216; border: 1px solid #0EC216;margin-right: 30px;" @click="adusitFUn">审核通过</el-button>
         <el-button size="small" type="primary" style="background-color: #DE504C; border: 1px solid #DE504C;" @click="quotedetailsdialogVisible = false">关 闭</el-button>
       </span>
@@ -377,6 +414,9 @@ import QRCode from "qrcodejs2";
 export default {
   data() {
     return {
+      oldFeeInfo:[],//原始跟单费用比例
+      adjustFeeDescInfo:{},//调整费用时使用对象
+      adjustFeeFlag:false,
       queryOrders:"",
       value2: "",
       optionsStatus:[],
@@ -437,7 +477,6 @@ export default {
       this.companyList=res.data
     })
     this.$api.insCompany.dicType('insOrderStatus').then(res=>{
-      console.log(res)
       this.optionsStatus=res.data.ddList
       let filterArr = res.data.ddList.filter(item=>{
         return item.dictTag == '已承保'
@@ -465,9 +504,65 @@ export default {
     window.removeEventListener('resize', this.getDimensions);
   },
   methods: {
+    //交强费用比例调整
+    changeJqFeeRate(val){
+      if(!(val&&val!='')){
+        val=0;
+        this.adjustFeeDescInfo.jqOtherFeeRate=0;
+      }
+      //赋值总费用比例
+        this.adjustFeeDescInfo.jqAllFeeRate=Number(val)+Number(this.adjustFeeDescInfo.jqCommissionRate);
+      //赋值调整后金额
+      let totalFee=this.adjustFeeDescInfo.jqAllFeeRate*this.adjustFeeDescInfo.jqPremium/100;
+      console.log(totalFee)
+      totalFee=totalFee.toFixed(3);
+      console.log(totalFee)
+      totalFee=totalFee.substring(0, totalFee.length - 1);
+      console.log(totalFee)
+      let otherFee=Number(totalFee)-Number(this.adjustFeeDescInfo.jqCommissionAmount);
+      otherFee=otherFee.toFixed(3);
+      otherFee=otherFee.substring(0, otherFee.length - 1);
+      this.adjustFeeDescInfo.jqAllFeeAmount=totalFee;
+      this.adjustFeeDescInfo.jqOtherFeeAmount=otherFee;
+    },
+    //商业费用比例调整
+    changeSyFeeRate(val){
+      if(!(val&&val!='')){
+        val=0;
+        this.adjustFeeDescInfo.syOtherFeeRate=0;
+      }
+      //赋值总费用比例
+      this.adjustFeeDescInfo.syAllFeeRate=Number(val)+Number(this.adjustFeeDescInfo.syCommissionRate);
+      //赋值调整后金额
+      let totalFee=this.adjustFeeDescInfo.syAllFeeRate*this.adjustFeeDescInfo.syPremium/100;
+      totalFee=totalFee.toFixed(3);
+      totalFee=totalFee.substring(0, totalFee.length - 1);
+      let otherFee=Number(totalFee)-Number(this.adjustFeeDescInfo.syCommissionAmount);
+      otherFee=otherFee.toFixed(3);
+      otherFee=otherFee.substring(0, otherFee.length - 1);
+      this.adjustFeeDescInfo.syAllFeeAmount=totalFee;
+      this.adjustFeeDescInfo.syOtherFeeAmount=otherFee;
+    },
+    closeDialog(){
+      this.adjustFeeFlag=false;
+    },
+    //调整费用
+    adjustFee(){
+      this.adjustFeeFlag=!this.adjustFeeFlag;
+      if(!this.adjustFeeFlag){
+        //取消调整时,值置为原始比例
+        this.adjustFeeDescInfo={...this.oldFeeInfo}
+      }
+    },
     //审核通过
     adusitFUn(){
-      this.$api.task.auditFee({orderNo:this.orderInfo.orderno}).then((res) =>{
+      let subParam={
+        orderNo:this.orderInfo.orderno,
+        jqCostsProportionStr:this.adjustFeeDescInfo.jqAllFeeRate,
+        syCostsProportionStr:this.adjustFeeDescInfo.syAllFeeRate,
+        updateFlag:this.adjustFeeFlag?"1":"0",
+      }
+      this.$api.task.auditFee(subParam).then((res) =>{
         if(res.code==200){
           this.$message.success('审核通过')
           this.findPage();
@@ -534,12 +629,11 @@ export default {
       this.width = document.documentElement.clientWidth - 350 + 'px';
     },
     //应用详情
-    OrderDetails(dy, item) {
+    OrderDetails(dy) {
       let params = {
         orderNo: dy.orderno,
       }
       this.$api.task.feeDetail(params).then((res) => {
-        console.log(res)
         if (res.code == 200) {
           res.data.kindinfo.map((ele, index) => {
             switch (ele.kindCode) {
@@ -563,6 +657,8 @@ export default {
           });
           this.orderInfo = res.data
           this.feeDetailInfo=res.data.orderFeeResult;
+          this.oldFeeInfo=res.data.adjustFeeDescVo;
+          this.adjustFeeDescInfo={...this.oldFeeInfo}
           this.quotedetailsdialogVisible = true;
         } else {
           this.$message.error("订单获取失败");
@@ -609,7 +705,6 @@ export default {
     findPage() {
       this.loading = true;
       this.$api.task.queryPageOrder(this.pageRequest).then((res) => {
-        console.log(res)
         if (res.code == "200") {
           this.loading = false;
           this.pageResult = res.data.content;
@@ -1147,4 +1242,10 @@ export default {
 .FeeEnclosure /deep/ .el-table__empty-block{
   width: 100% !important;
 }
+
+.FeeEnclosure .feeadjust-input{
+  width: 35%;
+  height: 20px;
+  font-size: 13px;
+}
 </style>