Commit 3b0ec857 by 前端

平板配置

1 parent 75447cbd
...@@ -3,244 +3,250 @@ import request from "./request" ...@@ -3,244 +3,250 @@ import request from "./request"
const path = "dj.api." const path = "dj.api."
// 内容管理列表查询条件可见门店列表 // 内容管理列表查询条件可见门店列表
export function getMerchantList (data) { export function getMerchantList(data) {
data.method = `dj.smartcarlife.api.shopMerchant.list` data.method = `dj.smartcarlife.api.shopMerchant.list`
return request(data) return request(data)
} }
// 内容管理列表查询 // 内容管理列表查询
export function getContenttList (data) { export function getContenttList(data) {
data.method = `${path}material.record.page` data.method = `${path}material.record.page`
return request(data) return request(data)
} }
// 内容管理详情 // 内容管理详情
export function getContentDetail (data) { export function getContentDetail(data) {
data.method = `${path}material.record.detail` data.method = `${path}material.record.detail`
return request(data) return request(data)
} }
// 批量启停用内容 // 批量启停用内容
export function batchOperaterContent (data) { export function batchOperaterContent(data) {
data.method = `${path}material.record.batch.operate` data.method = `${path}material.record.batch.operate`
return request(data) return request(data)
} }
// 删除内容 // 删除内容
export function delContent (data) { export function delContent(data) {
data.method = `${path}material.record.delete` data.method = `${path}material.record.delete`
return request(data) return request(data)
} }
// 统计列表 // 统计列表
export function getStatisticsList (data) { export function getStatisticsList(data) {
data.method = `dj.api.customer.dynamic.record.page` data.method = `dj.api.customer.dynamic.record.page`
return request(data) return request(data)
} }
// 导出统计列表 // 导出统计列表
export function exportStatisticsList (data) { export function exportStatisticsList(data) {
data.method = `dj.api.customer.dynamic.record.page.export` data.method = `dj.api.customer.dynamic.record.page.export`
return request(data) return request(data)
} }
// 新增内容 // 新增内容
export function addContent (data) { export function addContent(data) {
data.method = `${path}material.record.add` data.method = `${path}material.record.add`
return request(data, "post") return request(data, "post")
} }
// 编辑内容 // 编辑内容
export function updateContent (data) { export function updateContent(data) {
data.method = `${path}material.record.update` data.method = `${path}material.record.update`
return request(data, "post") return request(data, "post")
} }
// 获取会员权益/升级和积分商城 门店 // 获取会员权益/升级和积分商城 门店
export function getAllMerchantList (data) { export function getAllMerchantList(data) {
data.method = `dj.api.merchant.page` data.method = `dj.api.merchant.page`
return request(data, "POST") return request(data, "POST")
} }
// 获取精品升级/次新车转化/售后众筹 门店 // 获取精品升级/次新车转化/售后众筹 门店
export function getMerchantListByScene (data) { export function getMerchantListByScene(data) {
data.method = `dj.api.scenemerchantref.listShop4sByRef.page` data.method = `dj.api.scenemerchantref.listShop4sByRef.page`
return request(data) return request(data)
} }
// 获取精品升级/次新车转化/售后众筹 门店 // 获取精品升级/次新车转化/售后众筹 门店
export function getListShop4sByRef (data) { export function getListShop4sByRef(data) {
data.method = `dj.api.scenemerchantref.listShop4sByRef` data.method = `dj.api.scenemerchantref.listShop4sByRef`
return request(data) return request(data)
} }
// 获取品牌列表 // 获取品牌列表
export function getBrandList (data) { export function getBrandList(data) {
data.method = `dj.api.smartcarlife.common.car.brand.page` data.method = `dj.api.smartcarlife.common.car.brand.page`
return request(data) return request(data)
} }
// 分页查询标签员工 // 分页查询标签员工
export function getListLabelStaffPage (data) { export function getListLabelStaffPage(data) {
data.method = `dj.api.smartcarlife.contentManagerTask.listLabelStaffPage` data.method = `dj.api.smartcarlife.contentManagerTask.listLabelStaffPage`
return request(data) return request(data)
} }
// 员工群发-分页查询列表 // 员工群发-分页查询列表
export function contentManagerTaskPage (data) { export function contentManagerTaskPage(data) {
data.method = `dj.api.smartcarlife.contentManagerTask.page` data.method = `dj.api.smartcarlife.contentManagerTask.page`
return request(data, "POST") return request(data, "POST")
} }
// 员工群发-删除记录 // 员工群发-删除记录
export function deleteTaskById (data) { export function deleteTaskById(data) {
data.method = `dj.api.smartcarlife.contentManagerTask.deleteById` data.method = `dj.api.smartcarlife.contentManagerTask.deleteById`
return request(data, "POST") return request(data, "POST")
} }
// 员工群发-分页查询内容管理统计信息 // 员工群发-分页查询内容管理统计信息
export function getStatisticPage (data) { export function getStatisticPage(data) {
data.method = `dj.api.smartcarlife.contentManagerTask.statistic.page` data.method = `dj.api.smartcarlife.contentManagerTask.statistic.page`
return request(data, "POST") return request(data, "POST")
} }
// 员工群发-添加/修改记录 // 员工群发-添加/修改记录
export function insertOrUpdate (data) { export function insertOrUpdate(data) {
data.method = `dj.api.smartcarlife.contentManagerTask.insertOrUpdate` data.method = `dj.api.smartcarlife.contentManagerTask.insertOrUpdate`
return request(data, "POST") return request(data, "POST")
} }
// 根据ID查询详细信息 // 根据ID查询详细信息
export function contentManagerTaskById (data) { export function contentManagerTaskById(data) {
data.method = `dj.api.smartcarlife.contentManagerTask.getById` data.method = `dj.api.smartcarlife.contentManagerTask.getById`
return request(data, "POST") return request(data, "POST")
} }
// 获取接待场景 // 获取接待场景
export function receptionSceneList (data) { export function receptionSceneList(data) {
data.method = "dj.api.material.reception.scene.list" data.method = "dj.api.material.reception.scene.list"
return request(data, "POST") return request(data, "POST")
} }
// 获取客户标签树 // 获取客户标签树
export function getLabelList (data) { export function getLabelList(data) {
data.method = "dj.api.material.customer.label.list" data.method = "dj.api.material.customer.label.list"
return request(data, "POST") return request(data, "POST")
} }
// 单一商品 // 单一商品
export function listAllInWithPage (data) { export function listAllInWithPage(data) {
data.method = "dj.api.smartcarlife.upgradeGoods.listAllInWithPage" data.method = "dj.api.smartcarlife.upgradeGoods.listAllInWithPage"
return request(data, "POST") return request(data, "POST")
} }
// 套餐商品 // 套餐商品
export function allInPage (data) { export function allInPage(data) {
data.method = "dj.api.smartcarlife.merchantPackageGoodsInfo.allInPage" data.method = "dj.api.smartcarlife.merchantPackageGoodsInfo.allInPage"
return request(data, "POST") return request(data, "POST")
} }
// 获取产品词条列表 // 获取产品词条列表
export function productTextPage (data) { export function productTextPage(data) {
data.method = "dj.api.material.product.text.page" data.method = "dj.api.material.product.text.page"
return request(data, "POST") return request(data, "POST")
} }
// 分页获取产品词条列表 // 分页获取产品词条列表
export function productPage (data) { export function productPage(data) {
data.method = `dj.api.material.product.text.page` data.method = `dj.api.material.product.text.page`
return request(data, "POST") return request(data, "POST")
} }
// 获取产品词条详情 // 获取产品词条详情
export function productDetail (data) { export function productDetail(data) {
data.method = `dj.api.material.product.text.detail` data.method = `dj.api.material.product.text.detail`
return request(data, "POST") return request(data, "POST")
} }
// 删除产品词条 // 删除产品词条
export function productDelete (data) { export function productDelete(data) {
data.method = `dj.api.material.product.text.delete` data.method = `dj.api.material.product.text.delete`
return request(data, "POST") return request(data, "POST")
} }
// 保存产品词条 // 保存产品词条
export function productSave (data) { export function productSave(data) {
data.method = `dj.api.material.product.text.save` data.method = `dj.api.material.product.text.save`
return request(data, "POST") return request(data, "POST")
} }
// 更新产品词条 // 更新产品词条
export function productUpdate (data) { export function productUpdate(data) {
data.method = `dj.api.material.product.text.update` data.method = `dj.api.material.product.text.update`
return request(data, "POST") return request(data, "POST")
} }
// 查询接待素材商户配置 // 查询接待素材商户配置
export function materialPage (data) { export function materialPage(data) {
data.method = `dj.api.smartcarlife.recepiton.material.page` data.method = `dj.api.smartcarlife.recepiton.material.page`
return request(data, "post", [], "", "/rop-dj-car-boutique/router") return request(data, "post", [], "", "/rop-dj-car-boutique/router")
} }
// 查询门店接待素材详情 // 查询门店接待素材详情
export function materialDetail (data) { export function materialDetail(data) {
data.method = `dj.api.smartcarlife.recepiton.material.merchant.detail` data.method = `dj.api.smartcarlife.recepiton.material.merchant.detail`
return request(data, "post", [], "", "/rop-dj-car-boutique/router") return request(data, "post", [], "", "/rop-dj-car-boutique/router")
} }
// 获取车系列表
export function listBrandWithSeries(data) {
data.method = `dj.api.smartcarlife.merchantbrandmodel.listBrandWithSeries`
return request(data, "post")
}
// 保存更新门店接待素材 // 保存更新门店接待素材
export function recepitonUpdate (data) { export function recepitonUpdate(data) {
data.method = `dj.api.smartcarlife.recepiton.material.merchant.saveOrUpdate` data.method = `dj.api.smartcarlife.recepiton.material.merchant.saveOrUpdate`
return request(data, "post", [], "", "/rop-dj-car-boutique/router") return request(data, "post", [], "", "/rop-dj-car-boutique/router")
} }
// 保存更新门店接待素材 // 保存更新门店接待素材
export function findDictData (data) { export function findDictData(data) {
data.method = `merchants.api.menu.findDictData` data.method = `merchants.api.menu.findDictData`
return request(data, "post") return request(data, "post")
} }
// 保存更新门店接待素材 // 保存更新门店接待素材
export function deleteDictData (data) { export function deleteDictData(data) {
data.method = `merchants.api.menu.deleteDictData` data.method = `merchants.api.menu.deleteDictData`
return request(data, "post") return request(data, "post")
} }
// 保存更新门店接待素材 // 保存更新门店接待素材
export function updateDictData (data) { export function updateDictData(data) {
data.method = `merchants.api.menu.updateDictData` data.method = `merchants.api.menu.updateDictData`
return request(data, "post") return request(data, "post")
} }
// 保存更新门店接待素材 // 保存更新门店接待素材
export function saveDictData (data) { export function saveDictData(data) {
data.method = `merchants.api.menu.saveDictData` data.method = `merchants.api.menu.saveDictData`
return request(data, "post") return request(data, "post")
} }
/**客户标签列表 */ /**客户标签列表 */
export function getCustomerLabelPage (data) { export function getCustomerLabelPage(data) {
data.method = `dj.api.material.customer.label.page` data.method = `dj.api.material.customer.label.page`
return request(data, "post") return request(data, "post")
} }
/**新增客户标签 */ /**新增客户标签 */
export function addCustomerLabel (data) { export function addCustomerLabel(data) {
data.method = `dj.api.material.customer.label.add` data.method = `dj.api.material.customer.label.add`
return request(data, "post") return request(data, "post")
} }
/**修改客户标签 */ /**修改客户标签 */
export function updateCustomerLabel (data) { export function updateCustomerLabel(data) {
data.method = `dj.api.material.customer.label.update` data.method = `dj.api.material.customer.label.update`
return request(data, "post") return request(data, "post")
} }
/**分页查询客户档案信息(管理后台) */ /**分页查询客户档案信息(管理后台) */
export function getCustomerFilePage (data) { export function getCustomerFilePage(data) {
data.method = `dj.api.mindworkplate.customervisit.customerInfoListPage` data.method = `dj.api.mindworkplate.customervisit.customerInfoListPage`
return request(data, "post") return request(data, "post")
} }
/**客户档案信息(管理后台)导出 */ /**客户档案信息(管理后台)导出 */
export function exportCustomerFile (data) { export function exportCustomerFile(data) {
data.method = `dj.api.mindworkplate.customervisit.customerInfoListExport` data.method = `dj.api.mindworkplate.customervisit.customerInfoListExport`
return request(data, "post") return request(data, "post")
} }
/** 客户档案统计信息(管理后台) */ /** 客户档案统计信息(管理后台) */
export function getCustomerFileStatic (data) { export function getCustomerFileStatic(data) {
data.method = `dj.api.mindworkplate.customervisit.customerInfoListStatic` data.method = `dj.api.mindworkplate.customervisit.customerInfoListStatic`
return request(data, "post") return request(data, "post")
} }
/** 客户档案话术浏览记录 */ /** 客户档案话术浏览记录 */
export function getCustomerVisitScriptsListPage (data) { export function getCustomerVisitScriptsListPage(data) {
data.method = `dj.api.mindworkplate.customervisit.CustomerVisitScriptsListPage` data.method = `dj.api.mindworkplate.customervisit.CustomerVisitScriptsListPage`
return request(data, "post") return request(data, "post")
} }
/**客户档案标签 */ /**客户档案标签 */
export function getCustomerInfoDetail (data) { export function getCustomerInfoDetail(data) {
data.method = `dj.api.mindworkplate.customervisit.getCustomerInfoDetail` data.method = `dj.api.mindworkplate.customervisit.getCustomerInfoDetail`
return request(data, "post") return request(data, "post")
} }
...@@ -37,23 +37,41 @@ ...@@ -37,23 +37,41 @@
:style="{ width: picOptions.width, height: picOptions.height }" :style="{ width: picOptions.width, height: picOptions.height }"
v-else v-else
> >
<img class="photo-activity" :src="item" alt="" /> <template v-if="picOptions.style == 'button'">
<div <div class="view-box">
class="mask" <i class="el-icon-picture-outline"></i>
:style="{ width: picOptions.width, height: picOptions.height }" <div class="img-name">{{ getName(item) }}</div>
> <div
class="view-btn"
@click="handleEnlarge(item, 'img', index)"
>
预览
</div>
<i class="el-icon-close" @click="close('img', index)"></i>
</div>
</template>
<template v-else>
<img class="photo-activity" :src="item" alt="" />
<div <div
class="pic-pane-close" class="mask"
@click="handleEnlarge(item, 'img', index)" :style="{
width: picOptions.width,
height: picOptions.height
}"
> >
<img :src="require('@/assets/view.png')" alt="" /> <div
</div> class="pic-pane-close"
<template v-if="picOptions.isClose"> @click="handleEnlarge(item, 'img', index)"
<div class="pic-pane-close" @click="close('img', index)"> >
<img :src="require('@/assets/icon-delete.png')" alt="" /> <img :src="require('@/assets/view.png')" alt="" />
</div> </div>
</template> <template v-if="picOptions.isClose">
</div> <div class="pic-pane-close" @click="close('img', index)">
<img :src="require('@/assets/icon-delete.png')" alt="" />
</div>
</template>
</div>
</template>
</div> </div>
</div> </div>
</template> </template>
...@@ -65,37 +83,61 @@ ...@@ -65,37 +83,61 @@
(imageUrlArr && imageUrlArr.length == 0 && limit == 1) (imageUrlArr && imageUrlArr.length == 0 && limit == 1)
" "
> >
<div <template v-if="picOptions.style == 'button'">
class="upload-img" <div class="upload-box">
:style="{ width: picOptions.width, height: picOptions.height }" <el-button size="small" icon="el-icon-plus" @click="selectFile()">
@click="selectFile()" 上传图片
> </el-button>
<i class="el-icon-plus avatar-uploader-desc-icon"></i> <input
<div class="avatar-uploader-desc-word"> type="file"
上传{{ ref="uploadImgRef"
picOptions.noLimitType class="upload-img"
? "" :style="{ width: '100%', height: '100%' }"
: picOptions.type == "video" style="opacity: 0; z-index: -1"
? "视频" :accept="
: "图片" picOptions.noLimitType
}} ? '*'
: picOptions.type == 'video'
? '.mp4'
: '.jpg, .jpeg, .png,.webp'
"
@change="(e) => handleUpload(e)"
/>
</div> </div>
<input </template>
type="file" <template v-else>
ref="uploadImgRef" <div
@click="selectFile()"
class="upload-img" class="upload-img"
:style="{ width: picOptions.width, height: picOptions.height }" :style="{ width: picOptions.width, height: picOptions.height }"
style="opacity: 0; z-index: -1" >
:accept=" <i class="el-icon-plus avatar-uploader-desc-icon"></i>
picOptions.noLimitType <div class="avatar-uploader-desc-word">
? '*' 上传{{
: picOptions.type == 'video' picOptions.noLimitType
? '.mp4' ? ""
: '.jpg, .jpeg, .png,.webp' : picOptions.type == "video"
" ? "视频"
@change="(e) => handleUpload(e)" : "图片"
/> }}
</div> </div>
<input
type="file"
ref="uploadImgRef"
class="upload-img"
:style="{ width: picOptions.width, height: picOptions.height }"
style="opacity: 0; z-index: -1"
:accept="
picOptions.noLimitType
? '*'
: picOptions.type == 'video'
? '.mp4'
: '.jpg, .jpeg, .png,.webp'
"
@change="(e) => handleUpload(e)"
/>
</div>
</template>
</template> </template>
<el-dialog <el-dialog
class="image-dialog" class="image-dialog"
...@@ -275,6 +317,9 @@ export default { ...@@ -275,6 +317,9 @@ export default {
}) })
} }
}, },
getName(name) {
return name.split("/").pop()
},
uploadVideoFn(e) { uploadVideoFn(e) {
this.uploadInfo = new upload({ this.uploadInfo = new upload({
showprocess: true, showprocess: true,
...@@ -334,6 +379,40 @@ export default { ...@@ -334,6 +379,40 @@ export default {
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.view-box {
width: 240px;
height: 32px;
border-radius: 4px;
opacity: 1;
background: #f4f6f7;
align-items: center;
display: flex;
padding: 0px 8px;
box-sizing: border-box;
font-size: 14px;
.el-icon-picture-outline {
color: #185efe;
}
.img-name {
width: 77px;
margin: 0px 4px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.view-btn {
color: #185efe;
cursor: pointer;
}
.el-icon-close {
margin-left: auto;
cursor: pointer;
}
}
.upload-box {
width: 95px;
height: 30px;
}
.activity-img-box { .activity-img-box {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
......
<template>
<d2-dialog
title="新增门店车型配置"
:is-visible="dialogVisible"
class="dailog-box"
width="36%"
@closeDialog="handleClose"
@confirmDialog="handleConfirm"
>
<el-form :model="form" :rules="rules" ref="ruleForm" v-loading="loading">
<el-form-item
label="请选择主营品牌"
:label-width="formLabelWidth"
prop="brandId"
>
<el-select
filterable
class="form-select"
v-model="form.brandId"
placeholder="请选择"
@change="changeBrand"
>
<el-option
v-for="(i, indx) in brandList"
:key="i.id"
:label="i.name"
:value="i.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="请选择车系"
:label-width="formLabelWidth"
@change="changeCar"
prop="carId"
v-if="form.brandId"
>
<el-select
filterable
class="form-select"
v-model="form.carId"
placeholder="请选择"
>
<el-option
v-for="(i, indx) in brandList[brandIndex].childs"
:key="i.id"
:label="i.name"
:value="i.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="请选择车型"
:label-width="formLabelWidth"
prop="carModelId"
v-if="form.carId"
>
<el-select
filterable
class="form-select"
v-model="form.carModelId"
placeholder="请选择"
@change="changeCarModel"
>
<el-option
v-for="(i, indx) in brandList[brandIndex].childs[carIndex].childs"
:key="i.id"
:label="i.name"
:value="i.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
</d2-dialog>
</template>
<script>
import { listBrandWithSeries } from "@api/contentManager"
export default {
name: "addBrandDialog",
data() {
return {
form: { carModelId: "", brandId: "", carId: "" },
brandList: [],
formLabelWidth: "120px",
brandIndex: 0,
carIndex: 0,
selectCar: null,
loading: false,
rules: {
brandId: [
{ required: true, message: "请选择主营品牌", trigger: ["change"] }
],
carId: [{ required: true, message: "请选择车系", trigger: ["change"] }],
carModelId: [
{ required: true, message: "请选择车型", trigger: ["change"] }
]
}
}
},
props: {
dialogVisible: Boolean,
merchantId: [String, Number]
},
async mounted() {
this.loading = true
listBrandWithSeries({ merchantId: this.merchantId }).then((res) => {
this.brandList = res
this.loading = false
})
},
methods: {
changeBrand(val) {
this.brandIndex = this.brandList.findIndex((e) => e.id === val)
this.form.carModelId = ""
this.form.carId = ""
},
changeCar(val) {
this.carIndex = this.brandList[this.brandIndex].childs.findIndex(
(e) => e.id === val
)
this.form.carModelId = ""
},
changeCarModel(val, v) {
const index = this.brandList[this.brandIndex].childs[
this.carIndex
].childs.findIndex((e) => e.id === val)
const { id: carModelId, name: carModelName } =
this.brandList[this.brandIndex].childs[this.carIndex].childs[index]
const { id: brandId, name: brandName } = this.brandList[this.brandIndex]
const { id: seriesId, name: seriesName } =
this.brandList[this.brandIndex].childs[this.carIndex]
this.selectCar = {
brandId,
brandName,
carModelId,
carModelName,
seriesId,
seriesName
}
},
handleConfirm() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.handleClose(this.selectCar)
}
})
},
handleClose(val) {
this.$emit("dialogClose", val)
}
}
}
</script>
<style lang="scss">
.dialog-title {
font-size: 14px;
line-height: 30px;
margin-bottom: 15px;
}
.form-select {
width: 50%;
}
</style>
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-09-06 09:49:46 * @Date: 2024-09-06 09:49:46
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-09-24 10:18:44 * @LastEditTime: 2024-12-03 15:27:57
* @FilePath: \dj-car-life-system\src\views\contentManager\packageConfig\components\addDialog.vue * @FilePath: \dj-car-life-system\src\views\contentManager\packageConfig\components\addDialog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<!-- 月度库存结算单弹窗 --> <!-- 月度库存结算单弹窗 -->
<template> <template>
<d2-dialog <d2-dialog
title="新增门店" :title="cloneId ? '复制全套素材到指定门店' : '新增门店'"
:is-visible="dialogVisible" :is-visible="dialogVisible"
class="dailog-box" class="dailog-box"
width="36%" width="36%"
...@@ -18,7 +18,11 @@ ...@@ -18,7 +18,11 @@
> >
<div v-loading="loading"> <div v-loading="loading">
<div class="dialog-title"> <div class="dialog-title">
请选择新增门店,新增门店的素材会复用默认门店的素材,可自定义修改 {{
cloneId
? "将该门店下所有车型的所有素材数据(不包含客户案例),复制或替换到指定门店"
: "请选择新增门店,新增门店的素材会复用默认门店的素材,可自定义修改"
}}
</div> </div>
<el-select <el-select
filterable filterable
...@@ -44,12 +48,15 @@ export default { ...@@ -44,12 +48,15 @@ export default {
name: "addDialog", name: "addDialog",
data() { data() {
return { return {
formData: {}, formData: { merchantId: "" },
loading: false loading: false
} }
}, },
props: { props: {
dialogVisible: Boolean dialogVisible: Boolean,
cloneId: {
type: Number
}
}, },
computed: { computed: {
...mapState("d2admin/merchant", ["merchantIdList"]) ...mapState("d2admin/merchant", ["merchantIdList"])
...@@ -69,14 +76,20 @@ export default { ...@@ -69,14 +76,20 @@ export default {
const merchantName = this.merchantIdList.find( const merchantName = this.merchantIdList.find(
(i) => i.merchantId === merchantId (i) => i.merchantId === merchantId
).merchantName ).merchantName
recepitonUpdate({ merchantId, configType: 0, merchantName }).then( let params = { merchantId, configType: 0, merchantName }
(res) => { if (this.cloneId) {
if (res) { params = {
this.handleClose() merchantId: merchantId,
this.$message.success("新增成功") merchantName,
} copyMerchantId: this.cloneId
}
}
recepitonUpdate(params).then((res) => {
if (res) {
this.handleClose()
this.$message.success("操作成功")
} }
) })
}, },
handleClose() { handleClose() {
this.$emit("dialogClose") this.$emit("dialogClose")
......
...@@ -11,13 +11,47 @@ ...@@ -11,13 +11,47 @@
<span>素材配置</span> <span>素材配置</span>
</div> </div>
<div class="info-form-main"> <div class="info-form-main">
<el-tabs v-model="packageName" class="tab-main"> <div class="add-brand">
<el-tab-pane <el-button
size="small"
icon="el-icon-plus"
v-if="merchantId && configInfo.length != 20"
@click="bandleAddBrand"
>
新增
</el-button>
</div>
<Tabs
:closable="configInfo.length > 1"
v-model="packageName"
type="card"
@tab-remove="removeBrandTab"
class="tab-main"
:tab-list-item="configInfo"
>
<Tab-pane
v-for="(item, index) in configInfo" v-for="(item, index) in configInfo"
:label="item.carModelName" :label="item.carModelName"
:name="item.carModelName" :name="item.carModelName"
:key="index" :key="item.carModelName"
> >
<div class="brand-header">
<div class="brand-header-left">
<div class="brand-label">
<label>*</label>
首页车型大图:
</div>
<glsx-preview
@change="({ arr }) => (item.modelDisplayPicurl = arr[0])"
:pic-options="brandImgOptions"
:image-url-arr="
item.modelDisplayPicurl ? [item.modelDisplayPicurl] : []
"
limit="1"
></glsx-preview>
<div class="tips">推荐尺寸:840*420,单个文件不超过10M</div>
</div>
</div>
<div <div
class="tab-content" class="tab-content"
v-for="(sItem, sIndex) in item.subItem" v-for="(sItem, sIndex) in item.subItem"
...@@ -386,8 +420,8 @@ ...@@ -386,8 +420,8 @@
</Tabs> </Tabs>
</div> </div>
</div> </div>
</el-tab-pane> </Tab-pane>
</el-tabs> </Tabs>
</div> </div>
</div> </div>
</div> </div>
...@@ -465,6 +499,12 @@ ...@@ -465,6 +499,12 @@
新增 新增
</div> </div>
</el-dialog> </el-dialog>
<add-brand
:dialogVisible="dialogBrandVisible"
v-if="dialogBrandVisible"
:merchantId="merchantId"
@dialogClose="addDialogClose"
/>
</d2-container> </d2-container>
</template> </template>
<script> <script>
...@@ -480,6 +520,7 @@ import preview from "../components/preview" ...@@ -480,6 +520,7 @@ import preview from "../components/preview"
import Tabs from "../components/tabs/tabs" import Tabs from "../components/tabs/tabs"
import TabPane from "../components/tabs/tab-pane" import TabPane from "../components/tabs/tab-pane"
import draggable from "vuedraggable" import draggable from "vuedraggable"
import addBrand from "./components/addBrand"
import { deepClone } from "@/common/util" import { deepClone } from "@/common/util"
const PACKAGE = { const PACKAGE = {
1: { 1: {
...@@ -513,6 +554,7 @@ export default { ...@@ -513,6 +554,7 @@ export default {
glsxPreview: preview, glsxPreview: preview,
TabPane, TabPane,
Tabs, Tabs,
addBrand,
draggable draggable
}, },
data() { data() {
...@@ -520,6 +562,7 @@ export default { ...@@ -520,6 +562,7 @@ export default {
imgSrc: imgSrc:
"https://img02.glsx.com.cn/weapp/resource/saas/app/material/case.jpg", "https://img02.glsx.com.cn/weapp/resource/saas/app/material/case.jpg",
dialogVisible: false, dialogVisible: false,
dialogBrandVisible: false,
brandLoading: false, brandLoading: false,
inputVal: "", inputVal: "",
caseVisible: false, caseVisible: false,
...@@ -527,6 +570,7 @@ export default { ...@@ -527,6 +570,7 @@ export default {
loading: false, loading: false,
isUpStatus: true, isUpStatus: true,
query: "", query: "",
merchantId: "",
brandOptions: [], brandOptions: [],
configInfo: [], configInfo: [],
caseInfo: [ caseInfo: [
...@@ -561,6 +605,14 @@ export default { ...@@ -561,6 +605,14 @@ export default {
limitSize: 100, limitSize: 100,
noLimitType: true noLimitType: true
}, },
brandImgOptions: {
width: "240px",
height: "32px",
style: "button",
isClose: true,
limitSize: 10,
noLimitType: true
},
brandList: [], brandList: [],
brandCheckedList: [], brandCheckedList: [],
brandFormList: [], brandFormList: [],
...@@ -576,6 +628,7 @@ export default { ...@@ -576,6 +628,7 @@ export default {
mounted() { mounted() {
const { merchantId, configType } = this.$route.query const { merchantId, configType } = this.$route.query
this.configType = configType this.configType = configType
this.merchantId = merchantId
this.query = this.$route.query this.query = this.$route.query
this.materialDetail(merchantId) this.materialDetail(merchantId)
this.getBrand() this.getBrand()
...@@ -618,8 +671,85 @@ export default { ...@@ -618,8 +671,85 @@ export default {
this.brandList = res.data this.brandList = res.data
}) })
}, },
handleSureBrand() { bandleAddBrand() {
this.brandVisible = false this.dialogBrandVisible = true
},
addDialogClose(val) {
this.dialogBrandVisible = false
if (val) {
console.log(this.configInfo)
const idx = this.configInfo.find(
(i) => i.carModelName == val.carModelName
)
if (idx) {
return this.$message.error("该车型已存在")
}
const brandIndex = this.configInfo.findIndex(
(i) => i.carModelName == this.packageName
)
let { packages, films, optionals, products } = deepClone(
this.configInfo[brandIndex]
)
console.log(
packages,
films,
optionals,
products,
"packages, films, optionals, product"
)
packages.forEach((i) => {
const obj = Object.keys(i.infoList[0]).reduce((acc, key) => {
if (key == "category") {
acc[key] = i.infoList[0][key]
} else {
acc[key] = ""
}
return acc
}, {})
i.infoList = [{ ...obj, ...val }]
})
packages = packages.filter((i) => i)
films.forEach((i) => {
console.log(i)
const obj = Object.keys(i.infoList[0]).reduce((acc, key) => {
if (key == "category") {
acc[key] = i.infoList[0][key]
} else {
acc[key] = ""
}
return acc
}, {})
i.infoList = [{ ...obj, ...val }]
})
films = films.filter((i) => i)
const obj = Object.keys(optionals[0]).reduce((acc, key) => {
acc[key] = ""
return acc
}, {})
optionals = [{ ...obj, ...val }]
products.forEach((i) => {
const obj = Object.keys(i.infoList[0]).reduce((acc, key) => {
if (key == "category") {
acc[key] = i.infoList[0][key]
} else {
acc[key] = ""
}
return acc
}, {})
i.infoList = [{ ...obj, ...val }]
})
products = products.filter((i) => i)
this.configInfo.push({
...val,
packages,
modelDisplayPicurl: "",
films,
optionals,
products,
subItem: [packages, films, products, optionals]
})
console.log(this.configInfo)
}
}, },
handleEditBrand(val) { handleEditBrand(val) {
this.brandVisible = true this.brandVisible = true
...@@ -744,6 +874,7 @@ export default { ...@@ -744,6 +874,7 @@ export default {
}) })
this.caseName = this.caseInfo[0].category this.caseName = this.caseInfo[0].category
this.packageName = this.configInfo[0].carModelName this.packageName = this.configInfo[0].carModelName
console.log(this.configInfo, "this.configInfo")
}, },
//设置置灰状态 //设置置灰状态
getDisabled(i) { getDisabled(i) {
...@@ -829,6 +960,14 @@ export default { ...@@ -829,6 +960,14 @@ export default {
this.caseVisible = false this.caseVisible = false
}, },
removeBrandTab(name) {
const index = this.configInfo.findIndex((i) => i.carModelName == name)
this.configInfo.splice(index, 1)
if (name == this.packageName) {
const len = this.configInfo.length - 1
this.packageName = this.configInfo[len].carModelName
}
},
removeTab(targetName, tab) { removeTab(targetName, tab) {
if (targetName == "窗膜") { if (targetName == "窗膜") {
return this.$message.warning("无法删除") return this.$message.warning("无法删除")
...@@ -924,11 +1063,25 @@ export default { ...@@ -924,11 +1063,25 @@ export default {
productInfoList: [], productInfoList: [],
optionalInfoList: [] optionalInfoList: []
} }
const carModelInfoList = []
/** /**
* infoList[]转为packageInfoList:[],productInfoList:[],filmInfoList:[] * infoList[]转为packageInfoList:[],productInfoList:[],filmInfoList:[]
*/ */
const keys = Object.keys(packageList) const keys = Object.keys(packageList)
this.configInfo.forEach((i) => { this.configInfo.forEach((i) => {
if (!i.modelDisplayPicurl) {
return this.$message.error("请校验并输入素材信息必填项")
}
carModelInfoList.push({
id: i.id,
brandId: i.brandId,
brandName: i.brandName,
carModelId: i.carModelId,
carModelName: i.carModelName,
modelDisplayPicurl: i.modelDisplayPicurl,
seriesId: i.seriesId,
seriesName: i.seriesName
})
i.subItem.forEach((sub, k) => { i.subItem.forEach((sub, k) => {
console.log(sub) console.log(sub)
if (!sub) return if (!sub) return
...@@ -966,6 +1119,7 @@ export default { ...@@ -966,6 +1119,7 @@ export default {
configType: 1, configType: 1,
merchantName, merchantName,
caseInfoList, caseInfoList,
carModelInfoList,
...packageList ...packageList
} }
}, },
...@@ -1087,11 +1241,38 @@ export default { ...@@ -1087,11 +1241,38 @@ export default {
} }
.info-form-main { .info-form-main {
padding: 20px; padding: 20px;
position: relative;
.add-brand {
position: absolute;
right: 20px;
top: 24px;
cursor: pointer;
z-index: 100;
}
.tab-main { .tab-main {
::v-deep.el-tabs__item { ::v-deep.el-tabs__item {
min-width: 100px; min-width: 100px;
text-align: center; text-align: center;
} }
.brand-header {
display: flex;
justify-content: space-between;
margin: 20px;
.brand-label {
color: #666666;
label {
color: #eb4e4e;
}
}
.tips {
color: #999999;
margin-left: 10px;
}
&-left {
display: flex;
align-items: center;
}
}
} }
.tab-content { .tab-content {
border: 1px solid #ebeef5; border: 1px solid #ebeef5;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<d2-container> --> <d2-container> -->
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header> <d2-table-header>
<el-button size="small" type="primary" @click="handleAdd"> <el-button size="small" type="primary" @click="handleDialog">
新增门店 新增门店
</el-button> </el-button>
</d2-table-header> </d2-table-header>
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
<el-button type="text" @click="handleEdit(scope.scope)"> <el-button type="text" @click="handleEdit(scope.scope)">
编辑 编辑
</el-button> </el-button>
<el-button type="text" @click="handleClone(scope.scope)">
复制素材
</el-button>
</div> </div>
</d2-table> </d2-table>
</div> </div>
...@@ -43,6 +46,7 @@ ...@@ -43,6 +46,7 @@
<add-dialog <add-dialog
:dialogVisible="dialogVisible" :dialogVisible="dialogVisible"
v-if="dialogVisible" v-if="dialogVisible"
:cloneId="cloneId"
@dialogClose="addDialogClose" @dialogClose="addDialogClose"
/> />
</div> </div>
...@@ -61,6 +65,8 @@ export default { ...@@ -61,6 +65,8 @@ export default {
return { return {
dialogVisible: false, dialogVisible: false,
labelWidth: "100px", labelWidth: "100px",
cloneId: null,
dialogType: "",
searchForm: { searchForm: {
merchantId: "", merchantId: "",
merchantName: "" merchantName: ""
...@@ -129,12 +135,18 @@ export default { ...@@ -129,12 +135,18 @@ export default {
resolve() resolve()
}) })
}, },
handleAdd() { handleDialog(val) {
if (!val) this.cloneId = null
this.dialogVisible = true this.dialogVisible = true
}, },
handleSearch() { handleSearch() {
this.$refs.recordTable.refreshTable(false, true) this.$refs.recordTable.refreshTable(false, true)
}, },
handleClone(row) {
const { merchantId } = row
this.cloneId = merchantId
this.handleDialog(true)
},
handleEdit(row) { handleEdit(row) {
const { id, merchantId, merchantName, configType } = row const { id, merchantId, merchantName, configType } = row
this.$router.push({ this.$router.push({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!