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