Commit cdeea166 by chenwq

首页-样式,联调;新车频道

1 parent b4697281
......@@ -296,6 +296,18 @@ const staticRoutes = Object.freeze([
path: '/material/materialDetail',
component: resolve => require([`@/views/material/materialDetail.vue`], resolve),
meta: {}
},
{
name: 'carList',
path: '/newCarManage/index',
component: resolve => require([`@/views/newCarManage/index.vue`], resolve),
meta: {}
},
{
name: 'editCar',
path: '/newCarManage/editCar',
component: resolve => require([`@/views/newCarManage/editCar.vue`], resolve),
meta: {}
}
])
export default staticRoutes
......@@ -103,9 +103,9 @@
<p class="edit-tips">建议尺寸660*270px,大小10M以内</p>
</div>
<!-- 金刚区管理 -->
<div slot="jgqBlock">
<el-checkbox-group v-model="editForm.jgqService" @change="handleChange">
<el-checkbox v-for="(item, index) in baseData.jgqServiceList" :label="item.confId" :key="index">{{ item.confName }}</el-checkbox>
<div slot="clueBlock">
<el-checkbox-group v-model="editForm.clueList" @change="handleChange">
<el-checkbox v-for="(item, index) in baseData.clueList" :label="item.confId" :key="index">{{ item.confName }}</el-checkbox>
</el-checkbox-group>
</div>
<template slot="customerServerSuffix" slot-scope="scope">
......@@ -121,9 +121,9 @@
<div class="wechat-container m-r-20" style="margin-top: 59px">
<div class="wechat-box">
<img class="w-100-per" src="@/assets/phone.png" />
<img class="wechant-back" src="@/assets/home-set.png" />
<img class="wechant-back" src="@/assets/homeSet/home-set.png" />
<div class="wechant-banner-img img-w-h">
<img v-if="!editForm.bannerList.length" src="@/assets/home-set-default.png" />
<img v-if="!editForm.bannerList.length" src="@/assets/homeSet/home-set-default.png" />
<el-carousel v-else height="90px">
<el-carousel-item v-for="item in editForm.bannerList" :key="item">
<img class="img-w-h" :src="item.bannerImg" />
......@@ -136,6 +136,9 @@
<marquee width="200px" height="14px" scrolldelay="160">{{ editForm.noticeContent }}</marquee>
</span>
</div>
<img class="p-absolute icon-wbyy" :src="editForm.clueList.indexOf(1) != -1 ? require('@/assets/homeSet/icon-wbyy.png') : require('@/assets/homeSet/icon-wbyy-default.png')" />
<img class="p-absolute icon-jyfw" :src="editForm.clueList.indexOf(2) != -1 ? require('@/assets/homeSet/icon-jyfw.png') : require('@/assets/homeSet/icon-jyfw-default.png')" />
<img class="p-absolute icon-xcpd" :src="editForm.clueList.indexOf(3) != -1 ? require('@/assets/homeSet/icon-xcpd.png') : require('@/assets/homeSet/icon-xcpd-default.png')" />
</div>
</div>
</div>
......@@ -205,7 +208,7 @@ export default {
merchantQrcode: '',
noticeContent: '',
// preferentialPolicy: '',
jgqService: [],
clueList: [],
customerServerUserId: '',
bannerList: []
},
......@@ -288,7 +291,7 @@ export default {
{
label: '金刚区',
name: '',
addHtml: 'jgqBlock'
addHtml: 'clueBlock'
}
]
},
......@@ -336,17 +339,17 @@ export default {
// 基本信息
baseData: {
consultantList: [],
jgqServiceList: [
clueList: [
{
confId: '1',
confId: 1,
confName: '维保预约'
},
{
confId: '2',
confId: 2,
confName: '救援服务'
},
{
confId: '3',
confId: 3,
confName: '新车频道'
}
]
......@@ -369,6 +372,7 @@ export default {
this.editForm.bannerList = []
this.editForm.noticeContent = res.noticeContent
this.editForm.merchantQrcode = res.merchantQrcode
this.editForm.clueList = res.clueList.map(k => k.clueId)
// this.editForm.preferentialPolicy = res.preferentialPolicy
this.editForm.customerServerUserId = ''
// 在线客服
......@@ -614,7 +618,13 @@ export default {
params.bannerList[idx].bannerType = 0
}
})
// console.log(params)
// 金刚区管理
params.clueList = this.editForm.clueList.map(k => {
return {
clueId: k
}
})
console.log(params)
this.$apis.homeSet.updateHomeApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
......@@ -631,6 +641,9 @@ export default {
width: 264px;
height: 108px;
}
.home-set .p-absolute {
position: absolute;
}
.home-set .wechat-container .wechat-box .wechant-back {
width: 252px;
box-sizing: border-box;
......@@ -662,6 +675,18 @@ export default {
line-height: 14px;
color: #333333;
}
.home-set .wechat-container .wechat-box .icon-wbyy {
top: 262px;
left: 101px;
}
.home-set .wechat-container .wechat-box .icon-jyfw {
top: 262px;
left: 162px;
}
.home-set .wechat-container .wechat-box .icon-xcpd {
top: 315px;
left: 40px;
}
.home-set .wechat-container .wechat-box .el-carousel__button {
width: 5px !important;
}
......
<!-- 编辑新车 -->
<template>
<div class="edit-car marketing p-t-20 edit-box">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="selectMerchant" slot-scope="scope" class="select-merchant">
<el-button type="default" @click="handleRelateStoreClose(scope)">{{ editForm.merchantList.length ? '更换门店' : '+选择门店' }}</el-button>
</div>
<div slot="merchantTable" :style="{ 'margin-left': labelWidth, width: `calc(100% - ${labelWidth} )` }">
<GLTable v-show="editForm.merchantList.length" ref="warehousListRef" :hasPage="false" :tableParams="tableParams" :tableData="editForm.merchantList">
<span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleMerchantDelete(scope)">删除</el-button>
</span>
</GLTable>
</div>
</glsx-combi-form>
<relate-store-dialog v-if="relateStoreVisible" ref="relateStore" :relateStoreVisible="relateStoreVisible" :storeApi="storeApi" :storeSearchForm="storeSearchForm" :storeSelected="selectedList" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose">
<el-row slot>
<el-form :model="storeSearchForm" ref="relate" :inline="true" label-width="90px">
<el-form-item label="商户ID:" prop="merchantId">
<el-input :size="size" v-model.trim="storeSearchForm.merchantId" placeholder="请输入商户ID" clearable></el-input>
</el-form-item>
<el-form-item label="门店名称:" prop="merchantName">
<el-input :size="size" v-model.trim="storeSearchForm.merchantName" placeholder="请输入门店名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearchStore">搜索</el-button>
</el-form-item>
</el-form>
</el-row>
</relate-store-dialog>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
export default {
name: 'editCar',
data() {
return {
size: 'small',
title: '新增专区',
titleObj: {
1: '新增专区',
2: '编辑专区'
},
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
id: ''
},
editStatus: false,
labelWidth: '144px',
editForm: {
// 专区类型(1发现频道,2商城专区)
zoneType: '2',
zoneName: '',
zoneImg: '',
merchantList: []
},
editRule: {
zoneName: [{ required: true, message: '请输入专区名称', trigger: 'change' }],
zoneImg: [{ required: true, message: '请选择专区图片', trigger: 'change' }],
merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }]
},
isEdit: true,
editFormData: [
{
label: '专区名称',
name: 'zoneName',
type: 'input',
maxlength: 20
},
{
label: '专区图片',
name: 'zoneImg',
type: 'upload',
limitSize: 10,
maxPhotoNum: 1,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
}
},
{
label: '门店',
name: 'merchantList',
addHtml: 'selectMerchant',
style: {
'margin-bottom': '10px'
}
},
{
// label: '',
name: '',
addHtml: 'merchantTable'
}
],
// 选择门店
relateStoreVisible: false,
storeApi: this.$apis.common.getMerchantList,
storeSearchForm: {
merchantId: '',
merchantName: ''
},
selectedList: [],
// 门店表格
tableParams: {
tableOption: true,
tableColumns: [
{
label: '门店名称',
prop: 'merchantName'
}
]
}
}
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.query
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
},
methods: {
getInfo() {
this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => {
this.editForm.zoneName = res.zoneName
this.editForm.zoneImg = res.zoneImg
this.editForm.merchantList = res.merchantRefList
this.editForm.merchantList.forEach(item => {
item.merchantNo = item.merchantId
})
this.$nextTick(() => {
this.editStatus = false
})
})
},
// 选择门店
handleRelateStoreClose() {
this.selectedList = this.$common.utils.deepClone(this.editForm.merchantList)
this.relateStoreVisible = !this.relateStoreVisible
},
handleRelateStoreConfirm(selectedData) {
this.editForm.merchantList = selectedData
this.selectedList = selectedData
this.handleRelateStoreClose()
this.$refs.editFormRef.$refs[this.editChildRef].validateField('merchantList')
},
handleSearchStore() {
this.$refs.relateStore.handleCurrentChange(1)
},
handleMerchantDelete(obj) {
this.$messageBox.confirm('是否删除该门店?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
// type: 'error',
callback: action => {
if (action == 'confirm') {
var idx = this.editForm.merchantList.findIndex(item => item.merchantNo == obj.scope.merchantNo)
this.editForm.merchantList.splice(idx, 1)
}
}
})
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
if (this.routeInfo.addOrEdit == 2) {
params.id = this.routeInfo.id
}
params.merchantList = []
// 专区类型(1发现频道,2商城专区)
params.zoneType = '2'
this.editForm.merchantList.forEach(item => {
params.merchantList.push({
merchantId: item.merchantNo,
merchantName: item.merchantName,
merchantAccountLevel: item.merchantAccountLevel
})
})
// console.log(params)
this.$apis.zoneList.insertZoneApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
}
})
},
cancelJump() {
this.$router.push({
path: '/zoneList/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.cancelJump()
})
.catch(() => {})
} else {
this.cancelJump()
}
}
}
}
</script>
<style scoped>
.marketing.edit-car .select-merchant {
/* width: calc(98% - 140px); */
width: 98%;
}
</style>
<!-- 新车管理 -->
<template>
<div class="marketing p-t-20">
<div class="m-b-20">
<!-- <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增新车</el-button> -->
<GLButton :size="size" type="primary" fn="新增新车" class="el-icon-plus" @click="handleEdit(1)">新增新车</GLButton>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="default" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="zoneRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLButton type="text" fn="编辑" @click="handleEdit(2, scope.scope)">编辑</GLButton>
<el-button type="text" fn="删除" @click="handleDelete(scope.scope)">删除</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'carList',
data() {
return {
size: 'small',
url: url,
searchForm: {
zoneName: '',
createDate: []
},
// tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '车辆关键字',
name: 'zoneName',
type: 'input',
placeholder: '请输入车系名称',
maxlength: 20
},
{
label: '状态',
name: 'status',
type: 'select'
}
// {
// label: '创建日期',
// name: 'createDate',
// type: 'datePicker',
// isClear: true,
// pickerOptions: 'beforeRangePickerOptions'
// }
],
// 表格
getListApi: this.$apis.zoneList.getZoneListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '新车名称',
prop: 'zoneName'
},
{
label: '创建日期',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
}
},
mounted() { },
methods: {
// getParams() {
// var params = JSON.parse(JSON.stringify(this.searchForm))
// if (this.searchForm.createDate.length) {
// params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
// params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
// }
// delete params.createDate
// return params
// },
// beforeSearchFn() {
// return new Promise(resolve => {
// this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate
// resolve()
// })
// },
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
// addOrEdit == 1 ? this.$router.push('/zoneList/editZone/' + addOrEdit) : this.$router.push('/zoneList/editZone/' + addOrEdit + '/' + row.id)
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 1 ? '新建新车' : '编辑新车')
}
addOrEdit != 1 && (params.id = row.id)
this.$router.push({
path: '/zoneList/editZone',
query: params
})
},
handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该新车?', 'zoneList', 'deleteZoneApi', { id: row.id })
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.zoneRef.data.length ? (this.$refs.zoneRef.tableHeightValues = '') : this.$refs.zoneRef.setTableHeightFun()
},
handleSearch() {
this.$refs.zoneRef.refreshTable()
},
handleReset() {
this.searchForm = {
zoneName: '',
createDate: []
}
this.handleSearch()
}
}
}
</script>
<style scoped></style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!