Commit 956f08d4 authored by lixy's avatar lixy

车型管理-创建车型

parent 5ebca190
......@@ -100,7 +100,6 @@ export function updateAndAdd(params) {
});
}
// vehicle/vehicleModel/app/update
/**
* 编辑一条车型数据
* */
......@@ -111,3 +110,14 @@ export function updateVehicleModel(params) {
data: params
});
}
/*
* 新建一条车型数据
* */
export function addVehicleModel(params) {
return fetch({
url: '/vehicle/vehicleModel/app/add',
method: 'post',
data: params
});
}
......@@ -49,13 +49,13 @@
<el-table-column width="200" align="center" label="乘卧数量">
<template scope="scope">
<span>{{scope.row.number.name}}</span>
<span>{{scope.row.numberName}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="品牌">
<template scope="scope">
<span>{{scope.row.brand.name}}</span>
<span>{{scope.row.brandName}}</span>
</template>
</el-table-column>
......@@ -204,6 +204,7 @@
* */
handleCreate() {
this.modalTitle = '创建';
this.oneRow = {};
this.oneTypeDialogVisible = true;
},
/**
......
......@@ -186,7 +186,8 @@
getOneTypeById,
getAllParentLabel,
getLabelList,
updateVehicleModel
updateVehicleModel,
addVehicleModel
} from 'api/vehicleType';
import rsCode from '../../../utils/rsCode';
import {
......@@ -366,7 +367,45 @@
/**
* 创建
* */
create(){},
create(){
let params = {
number: this.form.number,//乘卧数量
brand: this.form.brand,//房车品牌
name: this.form.name,//房车名称
config: this.totalLabel.join(","),//房车配置
keyword: this.form.keyword,//房车关键标签
modelsDetails: this.form.modelsDetails,//房车详情
modelParam: JSON.stringify(this.form.modelParam),//房车参数
picture: this.form.picture,//轮播图
price: this.form.price,//租车价格
deposit: this.form.deposit,//总押金
vioDeposit: this.form.vioDeposit,
// "hotSign": this.form.hotSign,//热门车型
// "rentDiscountStatus":"0",//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
// "RentDiscountPrice":"",//租车优惠价格 固定优化价格
buyPrice: this.form.buyPrice,//购买价格
};
console.log(params);
console.log(this.form);
addVehicleModel(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
});
this.$emit("oneDialogEvent", true);
} else {
this.$notify({
title: '创建失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
},
/**
* 编辑
* */
......@@ -693,7 +732,7 @@
config: "",//房车配置
keyword: "",//房车关键标签
modelsDetails: "",//房车详情
modelParam: "",//房车参数
modelParam: [],//房车参数
picture: "",//轮播图
price: 0,//租车价格
deposit: 20000,//总押金
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment