dev
校文 3 years ago
parent 57aa6d42ef
commit 53e85dd528

@ -1,3 +1,11 @@
/*
* @Author: your name
* @Date: 2022-03-09 14:13:45
* @LastEditTime: 2022-03-09 15:55:49
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /yywc-evaluation/src/main.js
*/
import Vue from 'vue'
import App from './App.vue'
import router from "@/permission";
@ -6,6 +14,8 @@ import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI, {size: 'small'});
import '@/styles/index.less';
import store from "@/store";
import mixins from "@/mixins";
Vue.use(mixins);
import selfUi from "@/components/index.js";
Vue.use(selfUi);
Vue.config.productionTip = false

@ -0,0 +1,24 @@
/*
* @Author: your name
* @Date: 2022-03-09 15:53:55
* @LastEditTime: 2022-03-09 15:55:00
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /yywc-evaluation/src/mixins/index.js
*/
import { mapGetters, mapActions } from "vuex";
export default {
nstall(Vue) {
Vue.mixin({
computed: {
...mapGetters(['getScoreData'])
},
methods: {
...mapActions(['setScoreData',]),
},
filters: {
}
})
}
}

@ -1,29 +1,14 @@
/*
* @Author: your name
* @Date: 2022-02-14 11:54:56
* @LastEditTime: 2022-02-16 10:12:04
* @LastEditTime: 2022-03-09 15:49:33
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /yyac-system/src/store/actions.js
*/
const actions = {
setToken: ({ commit }, log) => {
commit('setToken', log);
},
setTags: ({ commit }, log) => {
commit('setTags', log);
},
setNavBarIndex: ({ commit }, log) => {
commit('setNavBarIndex', log);
},
delTags: ({ commit }, log) => {
commit('delTags', log)
},
setOpenedKeys: ({ commit }, log) => {
commit('setOpenedKeys', log);
},
delOpenedKeys: ({ commit }, log) => {
commit('delOpenedKeys', log);
setScoreData: ({ commit }, log) => {
commit('setScoreData', log);
},
}
export default actions

@ -1,23 +1,15 @@
/*
* @Author: your name
* @Date: 2022-02-14 11:56:12
* @LastEditTime: 2022-02-16 10:06:13
* @LastEditTime: 2022-03-09 15:52:11
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /yyac-system/src/store/getters.js
*/
const getters = {
getToken(state) {
return state.token
},
getTags(state) {
return state.tags
},
getNavBarIndex(state) {
return state.navBarIndex
},
getOpenedKeys(state) {
return state.openedKeys
getScoreData(state) {
return state.scoreData;
}
}
export default getters

@ -1,60 +1,17 @@
/*
* @Author: your name
* @Date: 2022-02-14 11:55:31
* @LastEditTime: 2022-02-16 10:13:40
* @LastEditTime: 2022-03-09 15:51:09
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /yyac-system/src/store/mutations.js
*/
import LS from 'cz-storage'
const mutations = {
setTags: (state, log) => {
const arr = state.tags;
if (Array.isArray(arr)) {
const n = arr.findIndex(ele => ele.path === log.path);
if (n === -1) {
arr.push(log);
}
let str = JSON.stringify(arr);
LS.put('tags', str, 1 / 8);
}
},
setToken: (state, log) => {
state.token = log
LS.put('token', log, 1 / 8);
},
setNavBarIndex: (state, log) => {
state.navBarIndex = log
LS.put('navBarIndex', log, 1 / 8);
},
delTags: (state, log) => {
const arr = state.tags;
arr.splice(log, 1);
let str = JSON.stringify(arr);
LS.put('tags', str);
},
setOpenedKeys: (state, log) => {
const arr = state.openedKeys;
if (Array.isArray(arr)) {
const n = arr.findIndex(ele => ele === log);
if (n === -1) {
arr.push(log);
}
let str = JSON.stringify(arr);
LS.put('openedKeys', str, 1 / 8);
}
},
delOpenedKeys: (state, log) => {
const arr = state.openedKeys;
if (Array.isArray(arr)) {
const n = arr.findIndex(ele => ele === log);
if (n != -1) {
arr.splice(n, 1);
}
let str = JSON.stringify(arr);
LS.put('openedKeys', str, 1 / 8);
}
setScoreData: (state, log) => {
state.scoreData = log;
const str = JSON.stringify(log);
LS.put('scoreData', str, 1 / 8);
},
}
export default mutations;

@ -1,17 +1,14 @@
/*
* @Author: your name
* @Date: 2022-02-14 11:56:51
* @LastEditTime: 2022-02-16 10:03:13
* @LastEditTime: 2022-03-09 15:48:08
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /yyac-system/src/store/state.js
*/
import LS from 'cz-storage'
const state = {
tags: JSON.parse(LS.get("tags"))|| [],
token: LS.get("token") || "",
navBarIndex: LS.get("navBarIndex") || "",
openedKeys: JSON.parse(LS.get("openedKeys")) || []
scoreData: JSON.parse(LS.get("scoreData"))|| {}
}
export default state;

@ -1,3 +1,11 @@
<!--
* @Author: your name
* @Date: 2022-03-09 14:13:46
* @LastEditTime: 2022-03-09 15:58:07
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE()
* @FilePath: /yywc-evaluation/src/views/Scoresituation/index.vue
-->
<template>
<div id="app">
<TopHeader title="车辆评估系统得分情况" />
@ -28,13 +36,18 @@
<script>
export default {
data() {
return {};
return {
initData: {}
};
},
methods: {
onSubmit() {
console.log("submit!");
},
},
created() {
this.initData = this.getScoreData;
}
};
</script>

@ -1,5 +1,5 @@
<template>
<div id="app">
<div class="app-container">
<TopHeader title="车辆评估系统" />
<div class="app-xt">
<el-form ref="form" label-position="left" :model="form">
@ -7,11 +7,8 @@
<el-input type="text" 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="monthrange" align="right" unlink-panels range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" @blur="getRemainderTime">
<el-date-picker v-model="form.month" type="month" placeholder="车辆年份" align="right">
</el-date-picker>
<el-select v-model="form.region" placeholder="请选择" style="width: 150px;">
<el-option v-for="item in region" :value="item.id" :key="item.id" :label="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item label="3.过户次数:">
<el-select v-model="form.frequency" placeholder="请选择" style="width: 150px;">
@ -19,7 +16,7 @@
</el-select>
</el-form-item>
<el-form-item label="4.公里数:">
<el-input type="text" v-model="form.Kilometers" style="width: 150px;"><i slot="suffix"></i></el-input>
<el-input type="text" v-model.number="form.Kilometers" style="width: 150px;"><i slot="suffix">万公里</i></el-input>
</el-form-item>
<el-form-item label="5.油漆面:">
<el-select v-model="form.surface" placeholder="请选择" style="width: 150px;">
@ -48,7 +45,7 @@
<el-checkbox label="左尾灯" name="type"></el-checkbox>
</el-col>
<el-col :span="4">
<el-checkbox label="前保险杠" name="type"></el-checkbox>
<el-checkbox label="前保险杠" name="type">前保险杠</el-checkbox>
</el-col>
<el-col :span="4">
<el-checkbox label="后保险杠" name="type"></el-checkbox>
@ -80,11 +77,18 @@
<el-radio label="发动机解体维修"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="9.:
柱发生修复后翼子板切割)">
<el-form-item label="9.是否发生重大事故:">
<el-radio-group v-model="form.accident">
<el-radio label="是"></el-radio>
<el-radio label="否"></el-radio>
<el-row>
<el-radio :label="1">
如有以下情况则视为重大事故发生纵梁修复安全气囊弹出车子四梁六柱发生修复后翼子板切割直接扣80分
</el-radio>
</el-row>
<el-row style="margin-top: 12px">
<el-radio :label="2">
发生纵梁修复 安全气囊弹出 最低值再7折
</el-radio>
</el-row>
</el-radio-group>
</el-form-item>
<el-form-item label="10.是否全程4S店保养:">
@ -102,6 +106,7 @@
</template>
<script>
import moment from "moment"
export default {
data() {
return {
@ -124,6 +129,7 @@ export default {
surface: 10,
Sheet: 10,
Kilometers: 15,
rePart: 13
},
region: [
{
@ -222,7 +228,7 @@ export default {
name: "10面",
},
{
id: 10,
id: 11,
name: "11面及以上",
},
],
@ -273,7 +279,7 @@ export default {
name: "10面",
},
{
id: 10,
id: 11,
name: "11面及以上",
},
],
@ -324,44 +330,70 @@ export default {
name: "10次",
},
{
id: 10,
id: 11,
name: "11次及以上",
},
],
};
},
methods: {
getRemainderTime(startTime, endTime) {
var s1 = new Date(startTime.replace(/-/g, "/")),
s2 = new Date(endTime.replace(/-/g, "/")),
runTime = parseInt((s2.getTime() - s1.getTime()) / 1000);
var year = Math.floor(runTime / 86400 / 365);
runTime = runTime % (86400 * 365);
var month = Math.floor(runTime / 86400 / 30);
return year + "," + month;
},
onSubmit() {
//
let frequency = this.afterSubmit.frequency - this.form.frequency;
//
let surface = this.afterSubmit.surface - this.from.surface;
//
let Sheet = this.afterSubmit.Sheet - this.from.Sheet;
// let frequency = this.afterSubmit.frequency - this.form.frequency;
// //
// let surface = this.afterSubmit.surface - this.from.surface;
// //
// let Sheet = this.afterSubmit.Sheet - this.from.Sheet;
//
let Kilometers =this.afterSubmit.Sheet - ((this.from.Kilometers * 10000) / this.getRemainderTime) ;
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));
let k = this.form.Kilometers*10000 / _data.months;
if(k === Infinity) {
Kilometers = 15;
} else {
Kilometers = 15 - (k - 1250) / 125;
}
Kilometers = Kilometers <= 0 ? 0 : Kilometers;
console.log(Kilometers)
// Kilometers =this.afterSubmit.Kilometers - ((this.from.Kilometers * 10000) / ) ;
} else {
Kilometers = 0;
}
//
let rePart = 13;
if(this.form.tick.length === 0) {
rePart = 13;
} else {
this.form.tick.forEach(ele => {
if(['右大灯','左大灯','前右后门','前左后门','后右后门','后左后门'].includes(ele)) {
rePart -= 4;
} else if(['前保险杠', '后保险杠', '右尾灯', '左尾灯'].includes(ele)) {
rePart -= 1;
} else {
rePart -= 2;
}
});
rePart = rePart <=0 ? 0 : rePart;
console.log(rePart)
}
//
let total = frequency + surface + Sheet + Kilometers;
console.log('month')
console.log("total score = " + total);
// let total = frequency + surface + Sheet + Kilometers;
// this.setScoreData(obj)
// console.log("total score = " + total);
},
},
};
</script>
<style lang="less" scoped>
#app {
width: 100%;
.app-container {
min-width: 1600px;
height: 100%;
}
.app-xt {

Loading…
Cancel
Save