<template>
<div >
<el-page-header @back="go(-1)" content="爱车信息"></el-page-header>
<el-form :model="item">
<div style="margin-top: 10px;background-color: white">
<div class="divider"></div>
<div style="display: flex;padding: 10px 20px">
<div style="flex: 1;text-align: left">车型</div>
<el-input style="outline: none;width: 200px" v-model="item.type"></el-input>
</div>
<div class="divider"></div>
<div style="display: flex;padding: 10px 20px">
<div style="flex: 1;text-align: left">购买时间</div>
<el-date-picker
v-model="item.buyTime"
type="month"
placeholder="购买月份">
</el-date-picker>
</div>
<div class="divider"></div>
<div style="display: flex;padding: 10px 20px">
<div style="flex: 1;text-align: left">车牌号</div>
<el-input style="outline: none;width: 200px" v-model="item.license"></el-input>
</div>
<div class="divider"></div>
<div style="display: flex;padding: 10px 20px">
<div style="flex: 1;text-align: left">车油</div>
<el-select v-model="item.oil" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</el-form>
<el-button style="width: 80%;margin: 10px auto 0" type="success" @click="submit">更新</el-button>
<div style="
background: url('https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg');background-size: contain;
opacity: 0.5; width: 100px;height: 100px;display: flex">
<i class="icon el-icon-plus" style="opacity: 1;font-size: 60px;color: black;align-self: center;margin: 0 auto"></i>
</div>
</div>
</template>
<script>
export default {
name: 'car',
data() {
return {
canEdit: false,
item: {
id: 0,
type: '奥迪A8',
buyTime: new Date().getTime(),
license: '浙DU4576',
oil: '92'
},
options: [
{value: 89, label: '#89'},
{value: 92, label: '#92'},
{value: 93, label: '#93'},
{value: 95, label: '#95'},
]
}
},
methods: {
// changePsw: function () {
// if (this.oldPsw.length === 0 || this.newPsw.length === 0)
// this.$message({
// message: "密码不得为空",
// type: "error"
// });
// else
// this.$message({
// message: "ok",
// type: "success"
// });
// },
submit: function () {
if (this.item.buyTime > 0)
this.item.buyTime = Math.round(this.item.buyTime / 1000);
//修改车
console.log(this.item)
}
}
}
</script>
<style>
body{
background-color: #eaeaea;
}
.text{
float: left;
}
.el-page-header{
background-color: #2c3e50;
color: white;
height: 50px;
line-height: 50px;
padding-left: 10px;
}
.el-page-header__content{
color: white;
}
.divider{
border-bottom: 1px solid #eaeaea;
width: 90%;
margin: 0 auto
}
</style>