Commit 7651dac2 authored by lixy's avatar lixy

Merge branch 'dev-td' of http://113.105.137.151:22280/youjj/cloud-platform-ui into dev-td

parents f023958c 8d2aae5c
<template> <template>
<!-- 车型:创建、编辑 --> <!-- 车型:创建、编辑 -->
<div> <div>
<h4>{{title}}</h4> <h4>{{ title }}</h4>
<el-form :model="form" :rules="rules" ref="form" label-width="90px"> <el-form :model="form" :rules="rules" ref="form" label-width="90px">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="车型名称" prop="name"> <el-form-item label="车型名称" prop="name">
<el-input v-model="form.name" placeholder="请输入车型名称"></el-input> <el-input
v-model="form.name"
placeholder="请输入车型名称"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="车型简介" prop="intro"> <el-form-item label="车型简介" prop="intro">
<el-input class="cx" v-model="form.intro" :rows="9" type="textarea" placeholder="请输入车型简介"></el-input> <el-input
class="cx"
v-model="form.intro"
:rows="9"
type="textarea"
placeholder="请输入车型简介"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -25,17 +33,33 @@ ...@@ -25,17 +33,33 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="房车品牌"> <el-form-item label="房车品牌">
<el-select class="filter-item" v-model.number="form.brand" placeholder="请选择房车品牌"> <el-select
<el-option v-for="(val, key, index) in brandlist " :key="val.id" :label="val.name" class="filter-item"
:value="val.id"></el-option> v-model.number="form.brand"
placeholder="请选择房车品牌"
>
<el-option
v-for="(val, key, index) in brandlist"
:key="val.id"
:label="val.name"
:value="val.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="乘卧数量"> <el-form-item label="乘卧数量">
<el-select class="filter-item" v-model="form.number" placeholder="请选择乘卧数量"> <el-select
<el-option v-for="(val, key, index) in numberList " :key="val.id" :label="val.name" class="filter-item"
:value="val.id"></el-option> v-model="form.number"
placeholder="请选择乘卧数量"
>
<el-option
v-for="(val, key, index) in numberList"
:key="val.id"
:label="val.name"
:value="val.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -43,24 +67,44 @@ ...@@ -43,24 +67,44 @@
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="房车原价" prop="operator"> <el-form-item label="房车原价" prop="operator">
<el-input v-model="form.price" type="number" min="0" placeholder="请输入房车原价"></el-input> <el-input
v-model="form.price"
type="number"
min="0"
placeholder="请输入房车原价"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="购买价格" prop="operator"> <el-form-item label="购买价格" prop="operator">
<el-input v-model="form.buyPrice" type="number" min="0" placeholder="请输入房车购买价格"></el-input> <el-input
v-model="form.buyPrice"
type="number"
min="0"
placeholder="请输入房车购买价格"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="总押金" prop="operator"> <el-form-item label="总押金" prop="operator">
<el-input v-model="form.deposit" type="number" min="0" placeholder="请输入总押金"></el-input> <el-input
v-model="form.deposit"
type="number"
min="0"
placeholder="请输入总押金"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="违章押金" prop="operator"> <el-form-item label="违章押金" prop="operator">
<el-input v-model="form.vioDeposit" type="number" min="0" placeholder="请输入违章押金"></el-input> <el-input
v-model="form.vioDeposit"
type="number"
min="0"
placeholder="请输入违章押金"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -74,20 +118,35 @@ ...@@ -74,20 +118,35 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-row v-if="form.rentDiscountStatus==2"> <el-row v-if="form.rentDiscountStatus == 2">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="普通会员"> <el-form-item label="普通会员">
<el-input v-model="form.pPrice" type="number" min="0" placeholder="请输入普通会员价格"></el-input> <el-input
v-model="form.pPrice"
type="number"
min="0"
placeholder="请输入普通会员价格"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="黄金会员"> <el-form-item label="黄金会员">
<el-input v-model="form.hPrice" type="number" min="0" placeholder="请输入黄金会员价格"></el-input> <el-input
v-model="form.hPrice"
type="number"
min="0"
placeholder="请输入黄金会员价格"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="钻石会员"> <el-form-item label="钻石会员">
<el-input v-model="form.zPrice" type="number" min="0" placeholder="请输入钻石会员价格"></el-input> <el-input
v-model="form.zPrice"
type="number"
min="0"
placeholder="请输入钻石会员价格"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -97,9 +156,23 @@ ...@@ -97,9 +156,23 @@
<el-col :span="8" v-for="(item, index) in labelList" :key="item.id"> <el-col :span="8" v-for="(item, index) in labelList" :key="item.id">
<el-form-item> <el-form-item>
<span <span
style="width: 150px;text-align:right;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;padding-right: 10px;">{{item.parent.name}}</span> style="
<el-input v-model="item.selectChild" readonly icon="edit" @click="editConfig(item)" width: 150px;
style="width: 70%;"></el-input> text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-right: 10px;
"
>{{ item.parent.name }}</span
>
<el-input
v-model="item.selectChild"
readonly
suffix-icon="el-icon-edit"
@click.native="editConfig(item)"
style="width: 70%"
></el-input>
<!--<el-select v-model="item.childNameLists" style="width: 80%" v-if="item.parent.isMore==1" multiple placeholder="请选择" @change = "selectItem">--> <!--<el-select v-model="item.childNameLists" style="width: 80%" v-if="item.parent.isMore==1" multiple placeholder="请选择" @change = "selectItem">-->
<!--<el-option--> <!--<el-option-->
<!--v-for="iitem in item.children"--> <!--v-for="iitem in item.children"-->
...@@ -130,20 +203,34 @@ ...@@ -130,20 +203,34 @@
<!--:value="item.value">--> <!--:value="item.value">-->
<!--</el-option>--> <!--</el-option>-->
<!--</el-select>--> <!--</el-select>-->
<el-input v-model="form.keyword" placeholder="请输入关键标签" readonly icon="edit" @click="editLabe"></el-input> <el-input
v-model="form.keyword"
placeholder="请输入关键标签"
readonly
icon="edit"
@click="editLabe"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="房车参数"> <el-form-item label="房车参数">
<el-button size="small" class="el-button el-button--primary" type="button" icon="plus" @click="addModelParam()"> <el-button
size="small"
class="el-button el-button--primary"
type="button"
icon="plus"
@click="addModelParam()"
>
添加 添加
</el-button> </el-button>
<el-col v-for="(item, index) in form.modelParam" :key="index"> <el-col v-for="(item, index) in form.modelParam" :key="index">
<el-form-item label="参数名称" style="margin: 10px 5px;"> <el-form-item label="参数名称" style="margin: 10px 5px">
<el-input style="width: 30%;" v-model="item.key"></el-input> <el-input style="width: 30%" v-model="item.key"></el-input>
<el-input style="width: 30%;" v-model="item.val"></el-input> <el-input style="width: 30%" v-model="item.val"></el-input>
<el-button type="danger" size="small" @click="delModelParam(index)">删除</el-button> <el-button type="danger" size="small" @click="delModelParam(index)"
>删除</el-button
>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form-item> </el-form-item>
...@@ -151,114 +238,205 @@ ...@@ -151,114 +238,205 @@
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:headers="getHeaderWithToken" :headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'" :action="BASE_API + '/api/universal/file/app/unauth/admin/upload'"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:on-progress="uploadProcess" :on-progress="uploadProcess"
list-type="picture"> list-type="picture"
<div slot="tip" class="el-upload__tip"><span style="color: red;">建议尺寸:320*228px</span></div> >
<el-progress v-show="imgFlag == true" type="circle" :percentage="percent" <div slot="tip" class="el-upload__tip">
style="margin-top: 20px"></el-progress> <span style="color: red">建议尺寸:320*228px</span>
<img v-if="$utils.isString(form.coverPic) && !$utils.isEmpty(form.coverPic) && !imgFlag" :src="form.coverPic" </div>
style="width:300px;max-height:300px;"> <el-progress
<i v-else-if="!imgFlag" class="el-icon-plus avatar-uploader-icon" v-show="imgFlag == true"
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> type="circle"
:percentage="percent"
style="margin-top: 20px"
></el-progress>
<img
v-if="
$utils.isString(form.coverPic) &&
!$utils.isEmpty(form.coverPic) &&
!imgFlag
"
:src="form.coverPic"
style="width: 300px; max-height: 300px"
/>
<i
v-else-if="!imgFlag"
class="el-icon-plus avatar-uploader-icon"
style="
lineheight: 100px;
width: 300px;
height: 100px;
border: 1px dashed #ccc;
"
></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="全景链接"> <el-form-item label="全景链接">
<el-input v-model="form.panoramaUrl" type="text" placeholder="请输入全景链接"></el-input> <el-input
v-model="form.panoramaUrl"
type="text"
placeholder="请输入全景链接"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="alt"> <el-form-item label="alt">
<el-input v-model="form.alt" type="text" placeholder="请输入替代文本"></el-input> <el-input
v-model="form.alt"
type="text"
placeholder="请输入替代文本"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="img-title"> <el-form-item label="img-title">
<el-input v-model="form.imgTitle" type="text" placeholder="请输入图片title"></el-input> <el-input
v-model="form.imgTitle"
type="text"
placeholder="请输入图片title"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="img-keyword"> <el-form-item label="img-keyword">
<el-input v-model="form.imgKeyword" type="text" placeholder="请输入图片关键字"></el-input> <el-input
v-model="form.imgKeyword"
type="text"
placeholder="请输入图片关键字"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="img-desc"> <el-form-item label="img-desc">
<el-input v-model="form.imgDesc" type="text" placeholder="请输入图片描述"></el-input> <el-input
v-model="form.imgDesc"
type="text"
placeholder="请输入图片描述"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="海报背景" :style="{display:'block'}"> <el-form-item label="海报背景" :style="{ display: 'block' }">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:headers="getHeaderWithToken" :headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'" :action="BASE_API + '/api/universal/file/app/unauth/admin/upload'"
:show-file-list="false" :show-file-list="false"
:on-success="handlePosterSuccess" :on-success="handlePosterSuccess"
:on-progress="uploadPosterProcess" :on-progress="uploadPosterProcess"
list-type="picture"> list-type="picture"
<div slot="tip" class="el-upload__tip"><span style="color: red;">建议尺寸:320*228px</span></div> >
<el-progress v-show="imgPosterFlag == true" type="circle" :percentage="percent_poster" <div slot="tip" class="el-upload__tip">
style="margin-top: 20px"></el-progress> <span style="color: red">建议尺寸:320*228px</span>
<img v-if="$utils.isString(form.posterBackground) && !$utils.isEmpty(form.posterBackground)&& !imgPosterFlag" </div>
:src="form.posterBackground" style="width:300px;max-height:300px;"> <el-progress
<i v-else-if="!imgPosterFlag" class="el-icon-plus avatar-uploader-icon" v-show="imgPosterFlag == true"
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> type="circle"
:percentage="percent_poster"
style="margin-top: 20px"
></el-progress>
<img
v-if="
$utils.isString(form.posterBackground) &&
!$utils.isEmpty(form.posterBackground) &&
!imgPosterFlag
"
:src="form.posterBackground"
style="width: 300px; max-height: 300px"
/>
<i
v-else-if="!imgPosterFlag"
class="el-icon-plus avatar-uploader-icon"
style="
lineheight: 100px;
width: 300px;
height: 100px;
border: 1px dashed #ccc;
"
></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="轮播图" :style="{display:'block'}"> <el-form-item label="轮播图" :style="{ display: 'block' }">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:headers="getHeaderWithToken" :headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'" :action="BASE_API + '/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleRemove" :on-remove="handleRemove"
:file-list="fileList2" :file-list="fileList2"
:on-success="handleBannerSuccess" :on-success="handleBannerSuccess"
list-type="picture"> list-type="picture"
<div slot="tip" class="el-upload__tip">最多上传5张 <span style="color: red;">建议尺寸:1080*470px</span></div> >
<el-button v-if="fileList2.length<5" size="small" type="primary">点击上传</el-button> <div slot="tip" class="el-upload__tip">
最多上传5张 <span style="color: red">建议尺寸:1080*470px</span>
</div>
<el-button v-if="fileList2.length < 5" size="small" type="primary"
>点击上传</el-button
>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-tabs v-model="activeName2" type="card"> <el-tabs v-model="activeName2" type="card">
<el-tab-pane label="车型详情" name="first"> <el-tab-pane label="车型详情" name="first">
<!--<Editor @input="handelIncrease" :value="form.modelsDetails" :myQuillEditor="'myQuillEditor'"></Editor>--> <!--<Editor @input="handelIncrease" :value="form.modelsDetails" :myQuillEditor="'myQuillEditor'"></Editor>-->
<div class="editor-container" v-if="activeName2=='first'"> <div class="editor-container" v-if="activeName2 == 'first'">
<UE :editorId="activeName2" :defaultMsg="form.modelsDetails" :config=config ref="ue" <UE
@ready="editorReadyEvent"></UE> :editorId="activeName2"
:defaultMsg="form.modelsDetails"
:config="config"
ref="ue"
@ready="editorReadyEvent"
></UE>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
<el-button type="primary" v-if="title=='创建'" @click="create('form')">确 定</el-button> <el-button type="primary" v-if="title == '创建'" @click="create('form')"
<el-button type="primary" v-if="title=='编辑'&&vehicleTypeList_btn_edit" @click="update('form')">确 定</el-button> >确 定</el-button
>
<el-button
type="primary"
v-if="title == '编辑' && vehicleTypeList_btn_edit"
@click="update('form')"
>确 定</el-button
>
</div> </div>
<!--配置弹框--> <!--配置弹框-->
<el-dialog :title="modalTitle" :visible.sync="configDialogVisible"> <el-dialog :title="modalTitle" :visible.sync="configDialogVisible">
<el-form label-width="90px"> <el-form label-width="90px">
<el-form-item v-if="configItem.parent.isMore==0"> <el-form-item v-if="configItem.parent.isMore == 0">
<el-radio-group v-model="childName"> <el-radio-group v-model="childName">
<el-radio v-for="item in configItemChildren" :key="item.id" :label="item.id">{{item.name}}</el-radio> <el-radio
v-for="item in configItemChildren"
:key="item.id"
:label="item.id"
>{{ item.name }}</el-radio
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="configItem.parent.isMore==1"> <el-form-item v-if="configItem.parent.isMore == 1">
<el-checkbox-group v-model="childNameLists"> <el-checkbox-group v-model="childNameLists">
<el-checkbox v-for="item in configItemChildren" :key="item.id" :label="item.id">{{item.name}}</el-checkbox> <el-checkbox
v-for="item in configItemChildren"
:key="item.id"
:label="item.id"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -272,7 +450,12 @@ ...@@ -272,7 +450,12 @@
<el-dialog title="关键标签编辑" :visible.sync="keywordDialogVisible"> <el-dialog title="关键标签编辑" :visible.sync="keywordDialogVisible">
<el-form label-width="90px"> <el-form label-width="90px">
<el-checkbox-group v-model="selectedLabel"> <el-checkbox-group v-model="selectedLabel">
<el-checkbox v-for="item in canSelectLabel" :key="item.id" :label="item.id">{{item.name}}</el-checkbox> <el-checkbox
v-for="item in canSelectLabel"
:key="item.id"
:label="item.id"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group> </el-checkbox-group>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -283,121 +466,124 @@ ...@@ -283,121 +466,124 @@
</div> </div>
</template> </template>
<style> <style>
textarea { textarea {
display: none; display: none;
} }
.el-upload-list { .el-upload-list {
display: flex; display: flex;
width: 100px; width: 100px;
} }
.el-upload-list li { .el-upload-list li {
margin-left: 10px; margin-left: 10px;
} }
</style> </style>
<script> <script>
// import Editor from "../../modal/editorTool";//富文本 // import Editor from "../../modal/editorTool";//富文本
import UE from '../../modal/Ueditor';//百度ue富文本 import UE from "../../modal/Ueditor"; //百度ue富文本
import { import {
getOneTypeById, getOneTypeById,
getAllParentLabel, getAllParentLabel,
getLabelList, getLabelList,
updateVehicleModel, updateVehicleModel,
addVehicleModel addVehicleModel,
} from 'api/vehicleType'; } from "api/vehicleType";
import rsCode from '../../../utils/rsCode'; import rsCode from "../../../utils/rsCode";
import { import { getToken } from "../../../utils/auth";
getToken import { mapGetters } from "vuex";
} from '../../../utils/auth'; import ElRow from "element-ui/packages/row/src/row";
import {mapGetters} from 'vuex'; import ElCol from "element-ui/packages/col/src/col";
import ElRow from "element-ui/packages/row/src/row"; import ElFormItem from "../../../../node_modules/element-ui/packages/form/src/form-item.vue";
import ElCol from "element-ui/packages/col/src/col"; import ElRadio from "../../../../node_modules/element-ui/packages/radio/src/radio.vue";
import ElFormItem from "../../../../node_modules/element-ui/packages/form/src/form-item.vue";
import ElRadio from "../../../../node_modules/element-ui/packages/radio/src/radio.vue";
export default { export default {
props: ["oneRow", "title", "brandlist", "numberList", "vehicleTypeList_btn_edit"], props: [
name: 'upkeepDialog', "oneRow",
"title",
"brandlist",
"numberList",
"vehicleTypeList_btn_edit",
],
name: "upkeepDialog",
components: { components: {
ElRadio, ElRadio,
ElFormItem, ElFormItem,
ElCol, ElCol,
ElRow, ElRow,
UE UE,
}, },
data() { data() {
return { return {
imgPosterFlag: false, imgPosterFlag: false,
percent_poster: 0, percent_poster: 0,
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
percent: 0,//上传进度 percent: 0, //上传进度
imgFlag: false, imgFlag: false,
config: { config: {
initialFrameWidth: null, initialFrameWidth: null,
initialFrameHeight: 350 initialFrameHeight: 350,
}, },
labelList: [],//全部车型标签 labelList: [], //全部车型标签
fileList2: [], fileList2: [],
activeName2: '',//房车详情 activeName2: "", //房车详情
form: { form: {
alt: '', alt: "",
imgTitle: undefined, imgTitle: undefined,
imgKeyword: undefined, imgKeyword: undefined,
imgDesc: undefined, imgDesc: undefined,
coverPic: '', coverPic: "",
pPrice: 0,//普通会员 pPrice: 0, //普通会员
hPrice: 0,//黄金会员 hPrice: 0, //黄金会员
zPrice: 0,//钻石会员 zPrice: 0, //钻石会员
name: undefined,//房车名称 name: undefined, //房车名称
config: "",//房车配置 config: "", //房车配置
keyword: "",//房车关键标签 keyword: "", //房车关键标签
modelsDetails: "",//房车详情 modelsDetails: "", //房车详情
modelParam: "",//房车参数 modelParam: "", //房车参数
picture: "",//轮播图 picture: "", //轮播图
price: 0,//租车价格 price: 0, //租车价格
deposit: 20000,//总押金 deposit: 20000, //总押金
vioDeposit: 0,//违章押金 vioDeposit: 0, //违章押金
hotSign: "2",//热门车型 1、热门 2、非热门 hotSign: "2", //热门车型 1、热门 2、非热门
rentDiscountStatus: "0",//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值 rentDiscountStatus: "0", //租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
rentDiscountPrice: 0,//租车优惠价格 固定优化价格 rentDiscountPrice: 0, //租车优惠价格 固定优化价格
buyPrice: 0,//购买价格 buyPrice: 0, //购买价格
intro: '', intro: "",
posterBackground: '',//海报背景 posterBackground: "", //海报背景
panoramaUrl:undefined, panoramaUrl: undefined,
}, },
showDestinationVisible: false,//编辑目的地 showDestinationVisible: false, //编辑目的地
showPathWayVisible: false,//编辑途径地 showPathWayVisible: false, //编辑途径地
rules: { rules: {
name: { name: {
type: 'string', type: "string",
required: true, required: true,
message: '请输入车型名称', message: "请输入车型名称",
trigger: 'blur' trigger: "blur",
} },
}, },
checkList: [],//已选中的标签 checkList: [], //已选中的标签
allCompanies: {}, allCompanies: {},
allCompaniesArr: [], allCompaniesArr: [],
oneTypeDialogVisible: false, oneTypeDialogVisible: false,
allUpkeepItems: null, allUpkeepItems: null,
dialogStatus: undefined, dialogStatus: undefined,
allLabelList: [],//全部标签 allLabelList: [], //全部标签
showName: "", showName: "",
configDialogVisible: false,//配置弹框 configDialogVisible: false, //配置弹框
modalTitle: "修改房车配置", modalTitle: "修改房车配置",
configItem: {parent: {isMore: 0}},//待编辑配置数据 configItem: { parent: { isMore: 0 } }, //待编辑配置数据
configItemChildren: [],//待配置的二级标签 configItemChildren: [], //待配置的二级标签
childNameLists: [], childNameLists: [],
childName: "", childName: "",
totalLabel: [],//关键标签id totalLabel: [], //关键标签id
canSelectLabel: [],//可选择的二级标签 canSelectLabel: [], //可选择的二级标签
selectedLabel: [],//已选中的标签 selectedLabel: [], //已选中的标签
keywordDialogVisible: false,//关键标签弹框 keywordDialogVisible: false, //关键标签弹框
} };
},
created() {
}, },
created() {},
watch: { watch: {
oneTypeDialogVisible(newValue, oldValue) { oneTypeDialogVisible(newValue, oldValue) {
if (!newValue) { if (!newValue) {
...@@ -411,13 +597,10 @@ ...@@ -411,13 +597,10 @@
this.oneTypeDialogVisible = true; this.oneTypeDialogVisible = true;
}, },
computed: { computed: {
...mapGetters([ ...mapGetters(["elements", "vehicleWarningMsgType"]),
'elements',
'vehicleWarningMsgType'
]),
getHeaderWithToken() { getHeaderWithToken() {
return {Authorization: getToken()}; return { Authorization: getToken() };
} },
}, },
methods: { methods: {
changeConfig() { changeConfig() {
...@@ -427,15 +610,15 @@ ...@@ -427,15 +610,15 @@
* 获取全部一级、二级分类数据 * 获取全部一级、二级分类数据
* */ * */
getAllTag() { getAllTag() {
let listQuery = {sort: 1, page: 1, limit: 10}; let listQuery = { sort: 1, page: 1, limit: 10 };
let that = this; let that = this;
getLabelList(listQuery).then(response => { getLabelList(listQuery).then((response) => {
let listRs = undefined; let listRs = undefined;
if (!this.$utils.isEmpty(response.data)) { if (!this.$utils.isEmpty(response.data)) {
listRs = response.data; listRs = response.data;
response.data.map(function (item) { response.data.map(function (item) {
item.childName = []; item.childName = [];
}) });
} }
this.labelList = listRs; this.labelList = listRs;
if (this.title == "编辑") { if (this.title == "编辑") {
...@@ -475,7 +658,7 @@ ...@@ -475,7 +658,7 @@
let labelArr = []; let labelArr = [];
that.labelList.map(function (i) { that.labelList.map(function (i) {
i.childNameLists.map(function (ii) { i.childNameLists.map(function (ii) {
labelArr.push(ii) labelArr.push(ii);
}); });
}); });
that.totalLabel = labelArr; that.totalLabel = labelArr;
...@@ -486,8 +669,8 @@ ...@@ -486,8 +669,8 @@
if (ic.id == c) { if (ic.id == c) {
canSelectLabel.push(ic); canSelectLabel.push(ic);
} }
}) });
}) });
}); });
this.canSelectLabel = canSelectLabel; this.canSelectLabel = canSelectLabel;
...@@ -532,26 +715,26 @@ ...@@ -532,26 +715,26 @@
* */ * */
create(formName) { create(formName) {
const set = this.$refs; const set = this.$refs;
set[formName].validate(valid => { set[formName].validate((valid) => {
if (valid) { if (valid) {
let params = { let params = {
number: this.form.number,//乘卧数量 number: this.form.number, //乘卧数量
brand: this.form.brand,//房车品牌 brand: this.form.brand, //房车品牌
name: this.form.name,//房车名称 name: this.form.name, //房车名称
config: this.totalLabel.join(","),//房车配置 config: this.totalLabel.join(","), //房车配置
keyword: this.form.keyword,//房车关键标签 keyword: this.form.keyword, //房车关键标签
modelsDetails: this.form.modelsDetails,//房车详情 modelsDetails: this.form.modelsDetails, //房车详情
modelParam: JSON.stringify(this.form.modelParam),//房车参数 modelParam: JSON.stringify(this.form.modelParam), //房车参数
picture: this.form.picture,//轮播图 picture: this.form.picture, //轮播图
coverPic: this.form.coverPic,//封面图 coverPic: this.form.coverPic, //封面图
posterBackground: this.form.posterBackground,//海报背景 posterBackground: this.form.posterBackground, //海报背景
price: this.form.price,//租车价格 price: this.form.price, //租车价格
deposit: this.form.deposit,//总押金 deposit: this.form.deposit, //总押金
vioDeposit: this.form.vioDeposit, vioDeposit: this.form.vioDeposit,
hotSign: this.form.hotSign,//热门车型 hotSign: this.form.hotSign, //热门车型
rentDiscountStatus: this.form.rentDiscountStatus,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值 rentDiscountStatus: this.form.rentDiscountStatus, //租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
buyPrice: this.form.buyPrice,//购买价格 buyPrice: this.form.buyPrice, //购买价格
alt: this.form.alt,//seo 标签优化 alt: this.form.alt, //seo 标签优化
intro: this.form.intro, intro: this.form.intro,
imgTitle: this.form.imgTitle, imgTitle: this.form.imgTitle,
imgKeyword: this.form.imgKeyword, imgKeyword: this.form.imgKeyword,
...@@ -559,25 +742,32 @@ ...@@ -559,25 +742,32 @@
panoramaUrl: this.form.panoramaUrl, panoramaUrl: this.form.panoramaUrl,
}; };
if (this.form.rentDiscountStatus == 2) { if (this.form.rentDiscountStatus == 2) {
params.rentDiscountPrice = this.form.pPrice + "," + this.form.hPrice + "," + this.form.zPrice//租车优惠价格 固定优化价格 params.rentDiscountPrice =
this.form.pPrice +
"," +
this.form.hPrice +
"," +
this.form.zPrice; //租车优惠价格 固定优化价格
} }
console.log(params); console.log(params);
console.log(this.form); console.log(this.form);
addVehicleModel(params).then(response => { addVehicleModel(params).then((response) => {
if (response.status === 200) { if (response.status === 200) {
this.$notify({ this.$notify({
title: '成功', title: "成功",
message: '创建成功', message: "创建成功",
type: 'success', type: "success",
duration: 2000 duration: 2000,
}); });
this.$emit("oneDialogEvent", true); this.$emit("oneDialogEvent", true);
} else { } else {
this.$notify({ this.$notify({
title: '创建失败', title: "创建失败",
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!', message: rsCode.msg[response.code]
type: 'error', ? rsCode.msg[response.code]
duration: 2000 : "操作失败!",
type: "error",
duration: 2000,
}); });
} }
}); });
...@@ -591,54 +781,61 @@ ...@@ -591,54 +781,61 @@
* */ * */
update(formName) { update(formName) {
const set = this.$refs; const set = this.$refs;
set[formName].validate(valid => { set[formName].validate((valid) => {
if (valid) { if (valid) {
let params = { let params = {
id: this.form.id, id: this.form.id,
number: this.form.number,//乘卧数量 number: this.form.number, //乘卧数量
brand: this.form.brand,//房车品牌 brand: this.form.brand, //房车品牌
name: this.form.name,//房车名称 name: this.form.name, //房车名称
config: this.totalLabel.join(","),//房车配置 config: this.totalLabel.join(","), //房车配置
keyword: this.form.keyword,//房车关键标签 keyword: this.form.keyword, //房车关键标签
modelsDetails: this.form.modelsDetails,//房车详情 modelsDetails: this.form.modelsDetails, //房车详情
modelParam: JSON.stringify(this.form.modelParam),//房车参数 modelParam: JSON.stringify(this.form.modelParam), //房车参数
picture: this.form.picture,//轮播图 picture: this.form.picture, //轮播图
price: this.form.price,//租车价格 price: this.form.price, //租车价格
coverPic: this.form.coverPic,//封面图 coverPic: this.form.coverPic, //封面图
posterBackground: this.form.posterBackground,//海报背景 posterBackground: this.form.posterBackground, //海报背景
deposit: this.form.deposit,//总押金 deposit: this.form.deposit, //总押金
vioDeposit: this.form.vioDeposit, vioDeposit: this.form.vioDeposit,
hotSign: this.form.hotSign,//热门车型 hotSign: this.form.hotSign, //热门车型
rentDiscountStatus: this.form.rentDiscountStatus,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值 rentDiscountStatus: this.form.rentDiscountStatus, //租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
// rentDiscountPrice:this.form.pPrice+","+this.form.hPrice+","+this.form.zPrice,//租车优惠价格 固定优化价格 // rentDiscountPrice:this.form.pPrice+","+this.form.hPrice+","+this.form.zPrice,//租车优惠价格 固定优化价格
buyPrice: this.form.buyPrice,//购买价格 buyPrice: this.form.buyPrice, //购买价格
alt: this.form.alt,//seo 标签优化 alt: this.form.alt, //seo 标签优化
intro: this.form.intro, intro: this.form.intro,
imgTitle: this.form.imgTitle, imgTitle: this.form.imgTitle,
imgKeyword: this.form.imgKeyword, imgKeyword: this.form.imgKeyword,
imgDesc: this.form.imgDesc, imgDesc: this.form.imgDesc,
panoramaUrl:this.form.panoramaUrl panoramaUrl: this.form.panoramaUrl,
}; };
if (this.form.rentDiscountStatus == 2) { if (this.form.rentDiscountStatus == 2) {
params.rentDiscountPrice = this.form.pPrice + "," + this.form.hPrice + "," + this.form.zPrice//租车优惠价格 固定优化价格 params.rentDiscountPrice =
this.form.pPrice +
"," +
this.form.hPrice +
"," +
this.form.zPrice; //租车优惠价格 固定优化价格
} }
console.log(params); console.log(params);
console.log(this.form); console.log(this.form);
updateVehicleModel(params).then(response => { updateVehicleModel(params).then((response) => {
if (response.status === 200) { if (response.status === 200) {
this.$notify({ this.$notify({
title: '成功', title: "成功",
message: '编辑成功', message: "编辑成功",
type: 'success', type: "success",
duration: 2000 duration: 2000,
}); });
this.$emit("oneDialogEvent", true); this.$emit("oneDialogEvent", true);
} else { } else {
this.$notify({ this.$notify({
title: '编辑失败', title: "编辑失败",
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!', message: rsCode.msg[response.code]
type: 'error', ? rsCode.msg[response.code]
duration: 2000 : "操作失败!",
type: "error",
duration: 2000,
}); });
} }
}); });
...@@ -673,7 +870,7 @@ ...@@ -673,7 +870,7 @@
console.log(this.form.modelParam); console.log(this.form.modelParam);
let c = { let c = {
key: "", key: "",
val: "" val: "",
}; };
this.form.modelParam.push(c); this.form.modelParam.push(c);
}, },
...@@ -697,7 +894,7 @@ ...@@ -697,7 +894,7 @@
if (ii == cc.id) { if (ii == cc.id) {
a.push(cc.name); a.push(cc.name);
} }
}) });
}); });
}); });
that.form.keyword = a.join(","); that.form.keyword = a.join(",");
...@@ -712,7 +909,7 @@ ...@@ -712,7 +909,7 @@
* 更新房车配置弹框 * 更新房车配置弹框
* **/ * **/
updateConfig() { updateConfig() {
debugger debugger;
let that = this; let that = this;
this.configDialogVisible = false; this.configDialogVisible = false;
if (this.configItem.parent.isMore == 0) { if (this.configItem.parent.isMore == 0) {
...@@ -726,7 +923,7 @@ ...@@ -726,7 +923,7 @@
let a = []; let a = [];
i.childNameLists[0] = that.childName; i.childNameLists[0] = that.childName;
} }
}) });
} }
}); });
console.log(that.labelList); console.log(that.labelList);
...@@ -747,7 +944,7 @@ ...@@ -747,7 +944,7 @@
}); });
i.selectChild = a.join(","); i.selectChild = a.join(",");
i.childNameLists = that.childNameLists; i.childNameLists = that.childNameLists;
}) });
} }
}); });
} }
...@@ -755,18 +952,18 @@ ...@@ -755,18 +952,18 @@
let labelStr = that.form.keyword.split(","); let labelStr = that.form.keyword.split(",");
that.labelList.map(function (i) { that.labelList.map(function (i) {
i.childNameLists.map(function (ii) { i.childNameLists.map(function (ii) {
labelArr.push(ii) labelArr.push(ii);
}); });
// let c = i.selectChild.split(","); // let c = i.selectChild.split(",");
// c.map(function (cc) { // c.map(function (cc) {
// labelStr.push(cc); // labelStr.push(cc);
// }) // })
}); });
this.totalLabel = labelArr;//房车配置选中的全部标签id this.totalLabel = labelArr; //房车配置选中的全部标签id
// that.form.keyword = labelStr.join(","); // that.form.keyword = labelStr.join(",");
that.form.keyword = "";// 改变房车配置时,清空关键标签显示的文字 that.form.keyword = ""; // 改变房车配置时,清空关键标签显示的文字
that.selectedLabel = [];// 改变房车配置时,清空关键标签选中的id that.selectedLabel = []; // 改变房车配置时,清空关键标签选中的id
let canSelectLabel = []; let canSelectLabel = [];
that.labelList.map(function (i) { that.labelList.map(function (i) {
...@@ -775,10 +972,10 @@ ...@@ -775,10 +972,10 @@
if (ic.id == c) { if (ic.id == c) {
canSelectLabel.push(ic); canSelectLabel.push(ic);
} }
})
})
}); });
this.canSelectLabel = canSelectLabel;//房车配置选中的全部标签,供关键标签选择使用 });
});
this.canSelectLabel = canSelectLabel; //房车配置选中的全部标签,供关键标签选择使用
console.log(this.canSelectLabel); console.log(this.canSelectLabel);
console.log(this.totalLabel); console.log(this.totalLabel);
console.log(that.form.keyword); console.log(that.form.keyword);
...@@ -787,6 +984,7 @@ ...@@ -787,6 +984,7 @@
* editConfig * editConfig
* */ * */
editConfig(item) { editConfig(item) {
console.log("123");
this.configDialogVisible = true; this.configDialogVisible = true;
this.childNameLists = []; this.childNameLists = [];
this.childName = undefined; this.childName = undefined;
...@@ -794,8 +992,8 @@ ...@@ -794,8 +992,8 @@
item.childNameList.map(function (ii) { item.childNameList.map(function (ii) {
ii.showName = ii.id; ii.showName = ii.id;
}); });
this.configItem = item;//待编辑配置信息 this.configItem = item; //待编辑配置信息
this.configItemChildren = item.children;//待配置的二级标签 this.configItemChildren = item.children; //待配置的二级标签
this.childNameLists = item.childNameLists; this.childNameLists = item.childNameLists;
this.childName = item.childNameLists[0]; this.childName = item.childNameLists[0];
console.log(item); console.log(item);
...@@ -805,19 +1003,21 @@ ...@@ -805,19 +1003,21 @@
* */ * */
getOne(id) { getOne(id) {
let that = this; let that = this;
getOneTypeById(id).then(response => { getOneTypeById(id).then((response) => {
let item = response.data; let item = response.data;
let pic = item.picture.split(","); let pic = item.picture.split(",");
//轮播 //轮播
let fileList2 = []; let fileList2 = [];
pic.map(function (pp) { pic.map(function (pp) {
let p = { let p = {
url: pp url: pp,
}; };
fileList2.push(p); fileList2.push(p);
}); });
this.fileList2 = fileList2; this.fileList2 = fileList2;
let yhPrice = item.rentDiscountPrice ? item.rentDiscountPrice.split(",") : []; let yhPrice = item.rentDiscountPrice
? item.rentDiscountPrice.split(",")
: [];
if (item.rentDiscountPrice) { if (item.rentDiscountPrice) {
item.pPrice = yhPrice.length >= 1 ? parseInt(yhPrice[0]) : 0; item.pPrice = yhPrice.length >= 1 ? parseInt(yhPrice[0]) : 0;
item.hPrice = yhPrice.length >= 2 ? parseInt(yhPrice[1]) : 0; item.hPrice = yhPrice.length >= 2 ? parseInt(yhPrice[1]) : 0;
...@@ -853,7 +1053,7 @@ ...@@ -853,7 +1053,7 @@
let labelArr = []; let labelArr = [];
that.labelList.map(function (i) { that.labelList.map(function (i) {
i.childNameLists.map(function (ii) { i.childNameLists.map(function (ii) {
labelArr.push(ii) labelArr.push(ii);
}); });
}); });
that.totalLabel = labelArr; that.totalLabel = labelArr;
...@@ -864,14 +1064,16 @@ ...@@ -864,14 +1064,16 @@
if (ic.id == c) { if (ic.id == c) {
canSelectLabel.push(ic); canSelectLabel.push(ic);
} }
}) });
}) });
}); });
this.canSelectLabel = canSelectLabel; this.canSelectLabel = canSelectLabel;
response.data.hotSign = response.data.hotSign ? response.data.hotSign : "2"; response.data.hotSign = response.data.hotSign
? response.data.hotSign
: "2";
this.form = response.data; this.form = response.data;
this.activeName2 = "first"; this.activeName2 = "first";
}) });
}, },
/** /**
* 深拷贝 * 深拷贝
...@@ -879,7 +1081,10 @@ ...@@ -879,7 +1081,10 @@
objDeepCopy(source) { objDeepCopy(source) {
var sourceCopy = source instanceof Array ? [] : {}; var sourceCopy = source instanceof Array ? [] : {};
for (var item in source) { for (var item in source) {
sourceCopy[item] = typeof source[item] === 'object' ? objDeepCopy(source[item]) : source[item]; sourceCopy[item] =
typeof source[item] === "object"
? objDeepCopy(source[item])
: source[item];
} }
return sourceCopy; return sourceCopy;
}, },
...@@ -890,7 +1095,9 @@ ...@@ -890,7 +1095,9 @@
selectArry.push(item); selectArry.push(item);
}); });
this.selectArry = selectArry; this.selectArry = selectArry;
var results = queryString ? selectArry.filter(this.createFilter(queryString)) : selectArry; var results = queryString
? selectArry.filter(this.createFilter(queryString))
: selectArry;
// 调用 callback 返回建议列表的数据 // 调用 callback 返回建议列表的数据
cb(results); cb(results);
}, },
...@@ -900,7 +1107,7 @@ ...@@ -900,7 +1107,7 @@
*/ */
editorReadyEvent(instance) { editorReadyEvent(instance) {
let t = this; let t = this;
instance.addListener('contentChange', () => { instance.addListener("contentChange", () => {
t.form.modelsDetails = instance.getContent(); t.form.modelsDetails = instance.getContent();
}); });
}, },
...@@ -928,7 +1135,7 @@ ...@@ -928,7 +1135,7 @@
* banner上传 * banner上传
* */ * */
handleBannerSuccess(res, file) { handleBannerSuccess(res, file) {
this.fileList2.push({url: res.data}); this.fileList2.push({ url: res.data });
let c = []; let c = [];
this.fileList2.map(function (i) { this.fileList2.map(function (i) {
c.push(i.url); c.push(i.url);
...@@ -941,54 +1148,54 @@ ...@@ -941,54 +1148,54 @@
cleanForm() { cleanForm() {
this.activeName2 = ""; this.activeName2 = "";
this.form = { this.form = {
number: undefined,//乘卧数量 number: undefined, //乘卧数量
brand: undefined,//房车品牌 brand: undefined, //房车品牌
name: '',//房车名称 name: "", //房车名称
config: '',//房车配置 config: "", //房车配置
keyword: '',//房车关键标签 keyword: "", //房车关键标签
modelsDetails: '',//房车详情 modelsDetails: "", //房车详情
modelParam: '',//房车参数 modelParam: "", //房车参数
picture: '',//轮播图 picture: "", //轮播图
coverPic: '',//封面图 coverPic: "", //封面图
posterBackground: '',//海报背景 posterBackground: "", //海报背景
price: undefined,//租车价格 price: undefined, //租车价格
deposit: 20000,//总押金 deposit: 20000, //总押金
vioDeposit: '', vioDeposit: "",
rentDiscountStatus: 0,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值 rentDiscountStatus: 0, //租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
buyPrice: undefined,//购买价格 buyPrice: undefined, //购买价格
alt: '',//seo 标签优化 alt: "", //seo 标签优化
intro: '', intro: "",
imgTitle: '', imgTitle: "",
imgKeyword: '', imgKeyword: "",
imgDesc: '', imgDesc: "",
pPrice: 0,//普通会员 pPrice: 0, //普通会员
hPrice: 0,//黄金会员 hPrice: 0, //黄金会员
zPrice: 0,//钻石会员 zPrice: 0, //钻石会员
hotSign: "2",//热门车型 1、热门 2、非热门 hotSign: "2", //热门车型 1、热门 2、非热门
rentDiscountPrice: 0,//租车优惠价格 固定优化价格 rentDiscountPrice: 0, //租车优惠价格 固定优化价格
} };
} },
} },
} };
</script> </script>
<style> <style>
.flex-aic { .flex-aic {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.left-item { .left-item {
width: 300px; width: 300px;
border-left: 1px solid #999; border-left: 1px solid #999;
border-right: 1px solid #999; border-right: 1px solid #999;
border-bottom: 1px solid #999; border-bottom: 1px solid #999;
padding: 3px; padding: 3px;
} }
.right-item { .right-item {
width: 400px; width: 400px;
border-right: 1px solid #999; border-right: 1px solid #999;
border-bottom: 1px solid #999; border-bottom: 1px solid #999;
padding: 3px; padding: 3px;
} }
</style> </style>
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