|
|
@ -4,7 +4,7 @@
|
|
|
|
<div class="app-xt">
|
|
|
|
<div class="app-xt">
|
|
|
|
<el-form ref="elForm" label-position="left" :model="form">
|
|
|
|
<el-form ref="elForm" label-position="left" :model="form">
|
|
|
|
<el-form-item label="1.车辆型号:">
|
|
|
|
<el-form-item label="1.车辆型号:">
|
|
|
|
<el-input type="text" v-model="form.name" style="width: 150px;"></el-input>
|
|
|
|
<el-input v-model="form.name" style="width: 150px;"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="2.车辆年份:">
|
|
|
|
<el-form-item label="2.车辆年份:">
|
|
|
|
<el-date-picker v-model="form.month" type="month" placeholder="车辆年份" align="right" style="width: 150px;">
|
|
|
|
<el-date-picker v-model="form.month" type="month" placeholder="车辆年份" align="right" style="width: 150px;">
|
|
|
@ -16,7 +16,8 @@
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="4.公里数:">
|
|
|
|
<el-form-item label="4.公里数:">
|
|
|
|
<el-input type="text" v-model.number="form.Kilometers" style="width: 150px;"><i slot="suffix">万公里</i></el-input>
|
|
|
|
<el-input-number :controls="false" v-model="form.Kilometers" style="width: 150px;"></el-input-number>
|
|
|
|
|
|
|
|
<i>万公里</i>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="5.油漆面:">
|
|
|
|
<el-form-item label="5.油漆面:">
|
|
|
|
<el-select v-model="form.surface" placeholder="请选择" style="width: 150px;">
|
|
|
|
<el-select v-model="form.surface" placeholder="请选择" style="width: 150px;">
|
|
|
@ -78,7 +79,7 @@
|
|
|
|
</el-radio-group>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="9.是否发生重大事故:">
|
|
|
|
<el-form-item label="9.是否发生重大事故:">
|
|
|
|
<el-checkbox-group v-model="form.accident" @change="accidentChange">
|
|
|
|
<el-checkbox-group v-model="form.accident">
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-checkbox :label="1">
|
|
|
|
<el-checkbox :label="1">
|
|
|
|
如有以下情况则视为重大事故:发生纵梁修复、安全气囊弹出、车子四梁六、柱发生修复、后翼子板切割直接扣80分
|
|
|
|
如有以下情况则视为重大事故:发生纵梁修复、安全气囊弹出、车子四梁六、柱发生修复、后翼子板切割直接扣80分
|
|
|
@ -93,8 +94,8 @@
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="10.是否全程4S店保养:">
|
|
|
|
<el-form-item label="10.是否全程4S店保养:">
|
|
|
|
<el-radio-group v-model="form.maintain">
|
|
|
|
<el-radio-group v-model="form.maintain">
|
|
|
|
<el-radio label="是"></el-radio>
|
|
|
|
<el-radio :label="1">是</el-radio>
|
|
|
|
<el-radio label="否"></el-radio>
|
|
|
|
<el-radio :label="2">否</el-radio>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-radio-group>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
@ -115,7 +116,7 @@ export default {
|
|
|
|
month: "",
|
|
|
|
month: "",
|
|
|
|
name: "",
|
|
|
|
name: "",
|
|
|
|
frequency: "",
|
|
|
|
frequency: "",
|
|
|
|
Kilometers: "",
|
|
|
|
Kilometers: undefined,
|
|
|
|
surface: "",
|
|
|
|
surface: "",
|
|
|
|
Sheet: "",
|
|
|
|
Sheet: "",
|
|
|
|
tick: [],
|
|
|
|
tick: [],
|
|
|
@ -280,36 +281,40 @@ export default {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
totalMonth: 0,
|
|
|
|
totalMonth: 0,
|
|
|
|
coefficient: "",
|
|
|
|
coefficient: "",
|
|
|
|
|
|
|
|
total: 0
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
accidentChange(val) {
|
|
|
|
|
|
|
|
console.log(val);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onSubmit() {
|
|
|
|
onSubmit() {
|
|
|
|
//过户得分
|
|
|
|
//过户得分
|
|
|
|
let frequency = 10 - this.form.frequency;
|
|
|
|
let frequency = 10 - this.form.frequency;
|
|
|
|
//油漆面得分
|
|
|
|
//油漆面得分
|
|
|
|
let surface = 10 - this.form.surface;
|
|
|
|
let surface = (11 - this.form.surface) <=0 ? 0 : (11 - this.form.surface);
|
|
|
|
//钣金面得分
|
|
|
|
//钣金面得分
|
|
|
|
let Sheet = 10 - this.form.Sheet;
|
|
|
|
let Sheet = (11 - this.form.Sheet*2) <= 0 ? 0 : (11 - this.form.Sheet*2);
|
|
|
|
//公里数得分
|
|
|
|
//公里数得分
|
|
|
|
let Kilometers = 0;
|
|
|
|
let Kilometers = 0;
|
|
|
|
if (this.form.Kilometers && this.form.month) {
|
|
|
|
if (this.form.Kilometers && this.form.month) {
|
|
|
|
const m1 = moment(moment().format("YYYY-MM-DD HH:mm:ss"));
|
|
|
|
const m1 = moment(moment().format("YYYY-MM-DD HH:mm:ss"));
|
|
|
|
const m2 = moment(this.form.month);
|
|
|
|
const m2 = moment(this.form.month);
|
|
|
|
let { _data } = moment.duration(m1.diff(m2));
|
|
|
|
let { _data } = moment.duration(m1.diff(m2));
|
|
|
|
this.totalMonth = _data.months;
|
|
|
|
console.log(_data)
|
|
|
|
let k = (this.form.Kilometers * 10000) / _data.months;
|
|
|
|
this.totalMonth = _data.years*12 + _data.months + 1;
|
|
|
|
if (k === Infinity) {
|
|
|
|
console.log(this.totalMonth)
|
|
|
|
Kilometers = 15;
|
|
|
|
let k = (this.form.Kilometers * 10000) / this.totalMonth;
|
|
|
|
|
|
|
|
let x = (k - 1250) / 125;
|
|
|
|
|
|
|
|
let y = 0;
|
|
|
|
|
|
|
|
if(x > 0) {
|
|
|
|
|
|
|
|
y = Math.round(x);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Kilometers = 15 - (k - 1250) / 125;
|
|
|
|
y = Math.floor(x*-1)*-1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Kilometers = 15 - y;
|
|
|
|
Kilometers = Kilometers <= 0 ? 0 : Kilometers;
|
|
|
|
Kilometers = Kilometers <= 0 ? 0 : Kilometers;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Kilometers = 0;
|
|
|
|
Kilometers = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(Kilometers)
|
|
|
|
// 更换件
|
|
|
|
// 更换件
|
|
|
|
let rePart = 13;
|
|
|
|
let rePart = 13;
|
|
|
|
if (this.form.tick.length === 0) {
|
|
|
|
if (this.form.tick.length === 0) {
|
|
|
@ -340,34 +345,28 @@ export default {
|
|
|
|
rePart = rePart <= 0 ? 0 : rePart;
|
|
|
|
rePart = rePart <= 0 ? 0 : rePart;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//变速箱状态
|
|
|
|
//变速箱状态
|
|
|
|
let engine = 40;
|
|
|
|
let transmission = 40;
|
|
|
|
if (this.form.transmission === 1) {
|
|
|
|
if (this.form.transmission === 1) {
|
|
|
|
engine -= 5;
|
|
|
|
transmission -= 5;
|
|
|
|
} else if (this.form.transmission === 2) {
|
|
|
|
} else if (this.form.transmission === 2) {
|
|
|
|
engine -= 20;
|
|
|
|
transmission -= 20;
|
|
|
|
|
|
|
|
} else if (this.form.transmission === 3) {
|
|
|
|
|
|
|
|
transmission -= 40;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
engine -= 40;
|
|
|
|
transmission = 40;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
engine = engine <= 0 ? 0 : engine;
|
|
|
|
transmission = transmission <= 0 ? 0 : transmission;
|
|
|
|
//保养
|
|
|
|
//保养
|
|
|
|
let maintain = 0;
|
|
|
|
let maintain = 0;
|
|
|
|
if (this.form.maintain === 1) {
|
|
|
|
if (this.form.maintain === 1) {
|
|
|
|
maintain = 5;
|
|
|
|
maintain = 5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//重大事故
|
|
|
|
|
|
|
|
if (this.form.accident.findIndex(1) != -1) {
|
|
|
|
|
|
|
|
total = 20;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.form.accident.findIndex(2) != -1) {
|
|
|
|
|
|
|
|
this.warn = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//年份系数
|
|
|
|
//年份系数
|
|
|
|
let year = this.totalMonth / 12;
|
|
|
|
let year = this.totalMonth / 12;
|
|
|
|
if (this.totalMonth / 12 != 0) {
|
|
|
|
if (this.totalMonth / 12 != 0) {
|
|
|
|
year++;
|
|
|
|
year++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let coefficient = coefficient;
|
|
|
|
let coefficient = 0;
|
|
|
|
if (year <= 3) {
|
|
|
|
if (year <= 3) {
|
|
|
|
coefficient = 1;
|
|
|
|
coefficient = 1;
|
|
|
|
} else if (year <= 8) {
|
|
|
|
} else if (year <= 8) {
|
|
|
@ -378,29 +377,29 @@ export default {
|
|
|
|
coefficient = 0.7;
|
|
|
|
coefficient = 0.7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//总分
|
|
|
|
//总分
|
|
|
|
let total =
|
|
|
|
this.total =
|
|
|
|
(frequency +
|
|
|
|
(frequency +
|
|
|
|
surface +
|
|
|
|
surface +
|
|
|
|
Sheet +
|
|
|
|
Sheet +
|
|
|
|
Kilometers +
|
|
|
|
Kilometers +
|
|
|
|
rePart +
|
|
|
|
rePart +
|
|
|
|
engine +
|
|
|
|
transmission +
|
|
|
|
maintain) *
|
|
|
|
maintain) *
|
|
|
|
coefficient;
|
|
|
|
coefficient;
|
|
|
|
console.log("total score = " + total);
|
|
|
|
|
|
|
|
let obj = {
|
|
|
|
let obj = {
|
|
|
|
frequency: frequency,
|
|
|
|
frequency: frequency,
|
|
|
|
surface: surface,
|
|
|
|
surface: surface,
|
|
|
|
Sheet: Sheet,
|
|
|
|
Sheet: Sheet,
|
|
|
|
Kilometers: Kilometers,
|
|
|
|
Kilometers: Kilometers,
|
|
|
|
rePart: rePart,
|
|
|
|
rePart: rePart,
|
|
|
|
engine: engine,
|
|
|
|
transmission: transmission,
|
|
|
|
maintain: maintain,
|
|
|
|
maintain: maintain,
|
|
|
|
total: total,
|
|
|
|
total: this.total,
|
|
|
|
|
|
|
|
accident: this.form.accident,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
this.setScoreData(obj);
|
|
|
|
this.setScoreData(obj);
|
|
|
|
this.elForm = this.$router.push("/Scoresituation");
|
|
|
|
this.$router.push("/Scoresituation");
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|