|
|
@@ -282,12 +282,12 @@
|
|
|
</el-col>
|
|
|
<el-col :span="10" :offset="2">
|
|
|
<el-form-item label="新车费用比例" prop="jqNewCarCostsProportion">
|
|
|
- <el-input v-model="productCostsitem.jqNewCarCostsProportion" placeholder="请输入新车费用比例"></el-input>
|
|
|
+ <el-input v-model="productCostsitem.jqNewCarCostsProportion" @blur="val => jqNewCarCostsProportioninput(val, schemeindex, productCostsindex)" placeholder="请输入新车费用比例"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
<el-form-item label="旧车费用比例" prop="jqOldCarCostsProportion">
|
|
|
- <el-input v-model="productCostsitem.jqOldCarCostsProportion" placeholder="请输入旧车费用比例"></el-input>
|
|
|
+ <el-input v-model="productCostsitem.jqOldCarCostsProportion" @blur="val => jqOldCarCostsProportioninput(val, schemeindex, productCostsindex)" placeholder="请输入旧车费用比例"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10" :offset="2">
|
|
|
@@ -302,7 +302,7 @@
|
|
|
<el-col :span="10" v-if="permissions">
|
|
|
<el-form-item label="总费用比例" prop="jqCostsProportion">
|
|
|
<el-input v-model="productCostsitem.jqCostsProportion"
|
|
|
- @input="val => jqCostsProportioninput(val, schemeindex, productCostsindex)"
|
|
|
+ @blur="val => jqCostsProportioninput(val, schemeindex, productCostsindex)"
|
|
|
placeholder="请输入总费用比例"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -334,12 +334,12 @@
|
|
|
</el-col>
|
|
|
<el-col :span="10" :offset="2">
|
|
|
<el-form-item label="新车费用比例" prop="syNewCarCostsProportion">
|
|
|
- <el-input v-model="productCostsitem.syNewCarCostsProportion" placeholder="请输入新车费用比例"></el-input>
|
|
|
+ <el-input v-model="productCostsitem.syNewCarCostsProportion" @blur="val => syNewCarCostsProportioninput(val, schemeindex, productCostsindex)" placeholder="请输入新车费用比例"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
<el-form-item label="旧车费用比例" prop="syOldCarCostsProportion">
|
|
|
- <el-input v-model="productCostsitem.syOldCarCostsProportion" placeholder="请输入旧车费用比例"></el-input>
|
|
|
+ <el-input v-model="productCostsitem.syOldCarCostsProportion" @blur="val => syOldCarCostsProportioninput(val, schemeindex, productCostsindex)" placeholder="请输入旧车费用比例"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="10" :offset="2">
|
|
|
@@ -354,7 +354,7 @@
|
|
|
<el-col :span="10" v-if="permissions">
|
|
|
<el-form-item label="总费用比例" prop="syCostsProportion">
|
|
|
<el-input v-model="productCostsitem.syCostsProportion" placeholder="请输入总费用比例"
|
|
|
- @input="val => syCostsProportioninput(val, schemeindex, productCostsindex)"></el-input>
|
|
|
+ @blur="val => syCostsProportioninput(val, schemeindex, productCostsindex)"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
@@ -1904,16 +1904,16 @@ export default {
|
|
|
jqNewCarCostsProportion: [
|
|
|
{ required: true, message: "请输入新车费用比例", trigger: "blur" },
|
|
|
{
|
|
|
- pattern: /^([0-9]{1,2}|100)$/,
|
|
|
- message: "请输入0-100的整数",
|
|
|
+ pattern: /^([0-4])$/,
|
|
|
+ message: "请输入0-4的整数",
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
],
|
|
|
jqOldCarCostsProportion: [
|
|
|
{ required: true, message: "请输入旧车费用比例", trigger: "blur" },
|
|
|
{
|
|
|
- pattern: /^([0-9]{1,2}|100)$/,
|
|
|
- message: "请输入0-100的整数",
|
|
|
+ pattern: /^([0-4])$/,
|
|
|
+ message: "请输入0-4的整数",
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
],
|
|
|
@@ -2412,20 +2412,89 @@ export default {
|
|
|
this.parentkeys = [];
|
|
|
}
|
|
|
},
|
|
|
+ jqNewCarCostsProportioninput(val, schemeindex, productCostsindex) {
|
|
|
+ let pay1 = this.costform.scheme[schemeindex].productCosts[productCostsindex].jqCostsProportion;//总
|
|
|
+ let pay2 = this.costform.scheme[schemeindex].productCosts[productCostsindex].jqNewCarCostsProportion;//新车
|
|
|
+ if(Number(pay1)>=Number(pay2)){
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqNewCarOtherCostsProportion = pay1 - pay2;
|
|
|
+ }else{
|
|
|
+ //如果总比例不够扣减,则置空重新填
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqCostsProportion=null
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqNewCarOtherCostsProportion=null;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqOldCarOtherCostsProportion=null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ jqOldCarCostsProportioninput(val, schemeindex, productCostsindex) {
|
|
|
+ let pay1 = this.costform.scheme[schemeindex].productCosts[productCostsindex].jqCostsProportion;//总
|
|
|
+ let pay3 = this.costform.scheme[schemeindex].productCosts[productCostsindex].jqOldCarCostsProportion;//旧车
|
|
|
+ if(Number(pay1)>=Number(pay3)){
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqOldCarOtherCostsProportion = pay1 - pay3;
|
|
|
+ }else{
|
|
|
+ //如果总比例不够扣减,则置空重新填
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqCostsProportion=null
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqNewCarOtherCostsProportion=null;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqOldCarOtherCostsProportion=null;
|
|
|
+ }
|
|
|
+ },
|
|
|
jqCostsProportioninput(val, schemeindex, productCostsindex) {
|
|
|
let pay1 = this.costform.scheme[schemeindex].productCosts[productCostsindex].jqCostsProportion;//总
|
|
|
let pay2 = this.costform.scheme[schemeindex].productCosts[productCostsindex].jqNewCarCostsProportion;//新车
|
|
|
let pay3 = this.costform.scheme[schemeindex].productCosts[productCostsindex].jqOldCarCostsProportion;//旧车
|
|
|
- this.costform.scheme[schemeindex].productCosts[productCostsindex].jqNewCarOtherCostsProportion = pay1 - pay2;
|
|
|
- this.costform.scheme[schemeindex].productCosts[productCostsindex].jqOldCarOtherCostsProportion = pay1 - pay3;
|
|
|
-
|
|
|
+ if(Number(pay1)>=Number(pay2)&&Number(pay1)>=Number(pay3)){
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqNewCarOtherCostsProportion = pay1 - pay2;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqOldCarOtherCostsProportion = pay1 - pay3;
|
|
|
+ }else{
|
|
|
+ //如果总比例不够扣减,则置空重新填
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqCostsProportion=null;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqNewCarOtherCostsProportion = null;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].jqOldCarOtherCostsProportion = null;
|
|
|
+ this.$message({
|
|
|
+ message: '总费用比例必须大于等于新车、旧车费用比例',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ syNewCarCostsProportioninput(val, schemeindex, productCostsindex) {
|
|
|
+ let pay1 = this.costform.scheme[schemeindex].productCosts[productCostsindex].syCostsProportion;//总
|
|
|
+ let pay2 = this.costform.scheme[schemeindex].productCosts[productCostsindex].syNewCarCostsProportion;//新车
|
|
|
+ if(Number(pay1)>=Number(pay2)){
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syNewCarOtherCostsProportion = pay1 - pay2;
|
|
|
+ }else{
|
|
|
+ //如果总比例不够扣减,则置空重新填
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syCostsProportion=null;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syNewCarOtherCostsProportion = null;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syOldCarOtherCostsProportion = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ syOldCarCostsProportioninput(val, schemeindex, productCostsindex) {
|
|
|
+ let pay1 = this.costform.scheme[schemeindex].productCosts[productCostsindex].syCostsProportion;//总
|
|
|
+ let pay3 = this.costform.scheme[schemeindex].productCosts[productCostsindex].syOldCarCostsProportion;//旧车
|
|
|
+ if(Number(pay1)>=Number(pay3)){
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syOldCarOtherCostsProportion = pay1 - pay3;
|
|
|
+ }else{
|
|
|
+ //如果总比例不够扣减,则置空重新填
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syCostsProportion=null;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syNewCarOtherCostsProportion = null;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syOldCarOtherCostsProportion = null;
|
|
|
+ }
|
|
|
},
|
|
|
syCostsProportioninput(val, schemeindex, productCostsindex) {
|
|
|
let pay1 = this.costform.scheme[schemeindex].productCosts[productCostsindex].syCostsProportion;//总
|
|
|
let pay2 = this.costform.scheme[schemeindex].productCosts[productCostsindex].syNewCarCostsProportion;//新车
|
|
|
let pay3 = this.costform.scheme[schemeindex].productCosts[productCostsindex].syOldCarCostsProportion;//旧车
|
|
|
- this.costform.scheme[schemeindex].productCosts[productCostsindex].syNewCarOtherCostsProportion = pay1 - pay2;
|
|
|
- this.costform.scheme[schemeindex].productCosts[productCostsindex].syOldCarOtherCostsProportion = pay1 - pay3;
|
|
|
+ if(Number(pay1)>=Number(pay2)&&Number(pay1)>=Number(pay3)){
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syNewCarOtherCostsProportion = pay1 - pay2;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syOldCarOtherCostsProportion = pay1 - pay3;
|
|
|
+ }else{
|
|
|
+ //如果总比例不够扣减,则置空重新填
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syCostsProportion=null;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syNewCarOtherCostsProportion = null;
|
|
|
+ this.costform.scheme[schemeindex].productCosts[productCostsindex].syOldCarOtherCostsProportion = null;
|
|
|
+ this.$message({
|
|
|
+ message: '总费用比例必须大于等于新车、旧车费用比例',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
//获取所有机构列表Start
|
|
|
getAllCompany() {
|
|
|
@@ -2664,8 +2733,67 @@ export default {
|
|
|
this.UnderwritingRules[1].rulesFactor[1].factor[0].OwnerId.parameter = OwnerId3;
|
|
|
this.UnderwritingRules[1].rulesFactor[1].factor[0].ApplicantId.parameter = ApplicantId3;
|
|
|
this.UnderwritingRules[1].rulesFactor[1].factor[0].InsureId.parameter = InsureId3;
|
|
|
+ //进行校验页面必填
|
|
|
+ let schemeCheckFlag=true; //费用方案校验标志,默认通过
|
|
|
+ let costSchemeNum=0;
|
|
|
+ if(this.costform.scheme.length>0){
|
|
|
+ for (let tempSchemeKind of this.costform.scheme) {
|
|
|
+ for(let tempCostScheme of tempSchemeKind.productCosts){
|
|
|
+ costSchemeNum+=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(costSchemeNum>0){
|
|
|
+ for(let i=0;i<costSchemeNum;i++){
|
|
|
+ this.$refs["costform"][i].validate(valid => {
|
|
|
+ if(!valid){
|
|
|
+ schemeCheckFlag=false;
|
|
|
+ //校验有错误,滚动到校验处
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let isError = document.getElementsByClassName('is-error')
|
|
|
+ isError[0].scrollIntoView({
|
|
|
+ block: 'center',
|
|
|
+ behavior: 'smooth',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //判断到一个失败,则跳出
|
|
|
+ if(!schemeCheckFlag){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let agreementCheckFlag=true;//协议信息校验标志
|
|
|
this.$refs["addAgreementRef"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
+ if(!valid){
|
|
|
+ agreementCheckFlag=false;
|
|
|
+ //校验有错误,滚动到校验处
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let isError = document.getElementsByClassName('is-error')
|
|
|
+ isError[0].scrollIntoView({
|
|
|
+ block: 'center',
|
|
|
+ behavior: 'smooth',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let accountCheckFlag=true;//保险公司账号配置信息校验标志
|
|
|
+ this.$refs["attributionform"].validate(valid => {
|
|
|
+ if(!valid){
|
|
|
+ accountCheckFlag=false;
|
|
|
+ //校验有错误,滚动到校验处
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let isError = document.getElementsByClassName('is-error')
|
|
|
+ isError[0].scrollIntoView({
|
|
|
+ block: 'center',
|
|
|
+ behavior: 'smooth',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //如果校验通过,则进行提交
|
|
|
+ if (agreementCheckFlag&&schemeCheckFlag&&accountCheckFlag) {
|
|
|
if (this.operType == 'ADD') {
|
|
|
|
|
|
let params = {
|
|
|
@@ -2719,9 +2847,23 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
- this.activeTabs = 'first';
|
|
|
+ this.$message({
|
|
|
+ message: '请检查页面必填信息!',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ if(!agreementCheckFlag){
|
|
|
+ this.activeTabs = 'first';
|
|
|
+ } else {
|
|
|
+ if(!schemeCheckFlag){
|
|
|
+ this.activeTabs = 'scheme';
|
|
|
+ } else{
|
|
|
+ if(!accountCheckFlag){
|
|
|
+ this.activeTabs='inscommany';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
+
|
|
|
},
|
|
|
//分页条数
|
|
|
handleSizeChange(val) {
|