Commit da5c669f by 胡悦

bug修复和UI调整

1 parent 9e022b2e
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
<template v-if="item.type == 'form'"> <template v-if="item.type == 'form'">
<div class="config-item"> <div class="config-item">
<div class="config-title"> <div class="config-title">
<div> <div @click="switchBox(item.id)">
<i class="el-icon-caret-bottom" style="color: #b9bcc4;"></i> <i class="el-icon-caret-bottom" :class="{ 'rotate-90': !item.isVisible }" style="color: #b9bcc4;"></i>
层级{{ index + 1 }} 层级{{ index + 1 }}
</div> </div>
<div> <div>
...@@ -58,17 +58,17 @@ ...@@ -58,17 +58,17 @@
<el-button type="text" :disabled="config.filter(i => i.type == 'form').length == 1" @click="deleteRow(index, item.id)">删除</el-button> <el-button type="text" :disabled="config.filter(i => i.type == 'form').length == 1" @click="deleteRow(index, item.id)">删除</el-button>
</div> </div>
</div> </div>
<div class="config-content"> <div class="config-content" :class="{ 'hide': !item.isVisible, 'show': item.isVisible }">
<el-form :ref="`subFormRef${item.id}`" :model="form[`subForm${item.id}`]" :rules="rulesForm" <el-form :ref="`subFormRef${item.id}`" :model="form[`subForm${item.id}`]" :rules="rulesForm"
label-width="120px"> label-width="120px">
<el-form-item label="素材标题:" prop="materialTitle"> <el-form-item label="素材标题:" prop="materialTitle">
<el-input type="text" v-model="form[`subForm${item.id}`].materialTitle" placeholder="请输入" <el-input style="width: 432px;" type="text" v-model="form[`subForm${item.id}`].materialTitle" placeholder="请输入"
maxlength="10" show-word-limit></el-input> maxlength="10" show-word-limit></el-input>
<div v-if="isCheck && !form[`subForm${item.id}`].materialTitle" class="error-tips">请输入素材标题</div> <div v-if="isCheck && !form[`subForm${item.id}`].materialTitle" class="error-tips">请输入素材标题</div>
<div class="tips">显示在素材标题栏</div> <div class="tips">显示在素材标题栏</div>
</el-form-item> </el-form-item>
<el-form-item label="素材简称:" prop="materialName"> <el-form-item label="素材简称:" prop="materialName">
<el-input type="text" v-model="form[`subForm${item.id}`].materialName" placeholder="请输入" <el-input style="width: 432px;" type="text" v-model="form[`subForm${item.id}`].materialName" placeholder="请输入"
maxlength="5" show-word-limit></el-input> maxlength="5" show-word-limit></el-input>
<div v-if="isCheck && !form[`subForm${item.id}`].materialName" class="error-tips">请输入素材简称</div> <div v-if="isCheck && !form[`subForm${item.id}`].materialName" class="error-tips">请输入素材简称</div>
<div class="tips">显示在文件夹</div> <div class="tips">显示在文件夹</div>
...@@ -133,8 +133,8 @@ ...@@ -133,8 +133,8 @@
<template v-if="item.type == 'builtIn'"> <template v-if="item.type == 'builtIn'">
<div class="config-item"> <div class="config-item">
<div class="config-title"> <div class="config-title">
<div> <div @click="switchBox(item.id)">
<i class="el-icon-caret-bottom" style="color: #b9bcc4;"></i> <i class="el-icon-caret-bottom" :class="{ 'rotate-90': !item.isVisible }" style="color: #b9bcc4;"></i>
层级{{ index + 1 }} 层级{{ index + 1 }}
</div> </div>
<div> <div>
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
@click="moveDown(index)">下移</el-button> @click="moveDown(index)">下移</el-button>
</div> </div>
</div> </div>
<div class="config-content"> <div class="config-content" :class="{ 'hide': !item.isVisible, 'show': item.isVisible }">
<el-form :model="form[`subForm${item.id}`]" label-width="120px"> <el-form :model="form[`subForm${item.id}`]" label-width="120px">
<el-form-item label="(内置)素材标题:"> <el-form-item label="(内置)素材标题:">
<div>{{ item.title }}</div> <div>{{ item.title }}</div>
...@@ -157,6 +157,7 @@ ...@@ -157,6 +157,7 @@
</template> </template>
</div> </div>
</div> </div>
<div v-if="isCheck && !formData.MaterialList.length" class="error-tips">请完善素材配置</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="padding-bottom: 40px; text-align: center"> <div style="padding-bottom: 40px; text-align: center">
...@@ -178,19 +179,22 @@ ...@@ -178,19 +179,22 @@
const default_config = [ const default_config = [
{ {
id: 1, id: 1,
type: 'form' type: 'form',
isVisible: true
}, },
{ {
id: 2, id: 2,
type: 'builtIn', type: 'builtIn',
title: '历史录单记录', title: '历史录单记录',
valueKey: 'history' valueKey: 'history',
isVisible: true
}, },
{ {
id: 3, id: 3,
type: 'builtIn', type: 'builtIn',
title: '保险告知书', title: '保险告知书',
valueKey: 'notice' valueKey: 'notice',
isVisible: true
} }
] ]
const default_form = { const default_form = {
...@@ -222,7 +226,8 @@ export default { ...@@ -222,7 +226,8 @@ export default {
return { return {
formData: { formData: {
isRelMerchant: '', isRelMerchant: '',
isRelBrand: 2 isRelBrand: 2,
MaterialList: []
}, },
rules: { rules: {
brandList: [ brandList: [
...@@ -256,10 +261,11 @@ export default { ...@@ -256,10 +261,11 @@ export default {
{ {
required: true, validator: (rule, value, callback) => { required: true, validator: (rule, value, callback) => {
const { MaterialList } = this.formData const { MaterialList } = this.formData
if (MaterialList && MaterialList.length != 0) { if (!isRelMerchant) callback("请完善素材配置")
callback() if (MaterialList && MaterialList.length == 0) {
} else {
callback("请完善素材配置") callback("请完善素材配置")
} else {
callback()
} }
}, trigger: "change" }, trigger: "change"
} }
...@@ -268,9 +274,9 @@ export default { ...@@ -268,9 +274,9 @@ export default {
brandVisible: false, brandVisible: false,
brandData: [], brandData: [],
checkBrand: [], checkBrand: [],
defaultKeys: [], defaultKeys: [], // 回显数据
storeVisible: false, storeVisible: false,
storeSelected: [], storeSelected: [], // 回显数据
storeData: [], storeData: [],
carSeriesVisible: false, carSeriesVisible: false,
form: deepClone(default_form), form: deepClone(default_form),
...@@ -329,14 +335,13 @@ export default { ...@@ -329,14 +335,13 @@ export default {
isPass: false, isPass: false,
levelId: 1, levelId: 1,
formInfo: null, formInfo: null,
levelOptionMapping: [1, 2, 3], levelOptionMapping: [1, 2, 3], // 互斥数组
seriesList: [], seriesList: [],
brandTreeData: [], brandTreeData: [],
key: new Date().getTime() key: new Date().getTime()
} }
}, },
mounted() { mounted() {
console.log(this.$route.query)
this.getDetail() this.getDetail()
}, },
methods: { methods: {
...@@ -363,6 +368,7 @@ export default { ...@@ -363,6 +368,7 @@ export default {
this.brandClose() this.brandClose()
this.brandData = val.newList this.brandData = val.newList
this.checkBrand = val.checkList this.checkBrand = val.checkList
if(val.checkList.length > 0) this.$refs.basicForm.clearValidate('brandList')
// 修改后,清空所有数据 // 修改后,清空所有数据
this.config = deepClone(default_config) this.config = deepClone(default_config)
this.form = deepClone(default_form) this.form = deepClone(default_form)
...@@ -383,10 +389,9 @@ export default { ...@@ -383,10 +389,9 @@ export default {
return return
} }
this.storeVisible = true this.storeVisible = true
// if () { this.storeSelected = this.storeData.length > 0 ? this.storeData : []
this.storeSelected = this.storeData.length > 0 ? this.storeData : []
// }
}, },
// 品牌选择回调
handleRelateStoreConfirm(selectedData) { handleRelateStoreConfirm(selectedData) {
console.log(selectedData) console.log(selectedData)
this.storeData = selectedData this.storeData = selectedData
...@@ -397,6 +402,7 @@ export default { ...@@ -397,6 +402,7 @@ export default {
handleRelateStoreClose() { handleRelateStoreClose() {
this.storeVisible = false this.storeVisible = false
}, },
// 删除门店
delMerchant(row) { delMerchant(row) {
console.log(row) console.log(row)
const filterArr = this.storeData.filter(i => i.id !== row.id) const filterArr = this.storeData.filter(i => i.id !== row.id)
...@@ -441,7 +447,8 @@ export default { ...@@ -441,7 +447,8 @@ export default {
addConfig() { addConfig() {
const obj = { const obj = {
id: new Date().getTime(), id: new Date().getTime(),
type: 'form' type: 'form',
isVisible: true
} }
this.config.unshift(obj) this.config.unshift(obj)
this.$set(this.form, `subForm${obj.id}`, deepClone(this.subForm)) this.$set(this.form, `subForm${obj.id}`, deepClone(this.subForm))
...@@ -527,6 +534,7 @@ export default { ...@@ -527,6 +534,7 @@ export default {
} }
if (arr.length > 2) { if (arr.length > 2) {
params.MaterialList = arr params.MaterialList = arr
this.formData.MaterialList = arr
this.isPass = true this.isPass = true
} }
if (this.isPass) console.log(params, 'params') if (this.isPass) console.log(params, 'params')
...@@ -558,6 +566,7 @@ export default { ...@@ -558,6 +566,7 @@ export default {
name: "packageConfig" name: "packageConfig"
}) })
}, },
// 上移下移
moveUp(targetIndex) { moveUp(targetIndex) {
console.log(targetIndex) console.log(targetIndex)
if (targetIndex > 0) { if (targetIndex > 0) {
...@@ -626,6 +635,7 @@ export default { ...@@ -626,6 +635,7 @@ export default {
// id: item.relBusinessId // id: item.relBusinessId
// } // }
// }) // })
// 品牌回显处理
console.log(this.checkBrand) console.log(this.checkBrand)
let checkList = [] let checkList = []
console.log(brandData, 'brandData') console.log(brandData, 'brandData')
...@@ -653,6 +663,7 @@ export default { ...@@ -653,6 +663,7 @@ export default {
this.checkBrand = checkList this.checkBrand = checkList
this.brandData = this.filterCheckList(deepClone(checkList)) this.brandData = this.filterCheckList(deepClone(checkList))
console.log(this.checkBrand, 'checkBrand', this.brandData) console.log(this.checkBrand, 'checkBrand', this.brandData)
// 门店回显处理
if (isRelMerchant == 2) { if (isRelMerchant == 2) {
this.storeData = storeData.map(i => { this.storeData = storeData.map(i => {
return { return {
...@@ -662,13 +673,15 @@ export default { ...@@ -662,13 +673,15 @@ export default {
}) })
} }
this.formData.isRelMerchant = isRelMerchant this.formData.isRelMerchant = isRelMerchant
// 配置回显
this.form = {} this.form = {}
let _config = [] let _config = []
const _homeEntranceType = [] const _homeEntranceType = []
materialInfoList.forEach(item => { materialInfoList.forEach(item => {
const obj = { const obj = {
id: item.id, id: item.id,
type: item.materialTitle ? 'form' : 'builtIn' type: item.materialTitle ? 'form' : 'builtIn',
isVisible: true
} }
if (item.materialType == 1) { if (item.materialType == 1) {
obj.title = '历史录单记录' obj.title = '历史录单记录'
...@@ -719,10 +732,15 @@ export default { ...@@ -719,10 +732,15 @@ export default {
}); });
} }
}); });
// 过滤掉一级项中 id 存在于 childrenIds 中的项 // 过滤掉一级项中 id 存在于 childrenIds 中的项
return checkList.filter(item => !childrenIds.has(item.id)); return checkList.filter(item => !childrenIds.has(item.id));
}, },
switchBox(id) {
const item = this.config.find(item => item.id === id);
if (item) {
item.isVisible = !item.isVisible; // 直接修改原对象属性
}
},
} }
} }
</script> </script>
...@@ -779,17 +797,30 @@ export default { ...@@ -779,17 +797,30 @@ export default {
font-size: 12px; font-size: 12px;
} }
.error-tips {
color: #f56c6c;
font-size: 12px;
}
} }
} }
} }
.error-tips {
color: #f56c6c;
font-size: 12px;
}
.pic-url { .pic-url {
width: 36px; width: 36px;
height: 36px; height: 36px;
vertical-align: middle; vertical-align: middle;
} }
.show {
display: block;
}
.hide {
display: none;
}
.rotate-90 {
transform: rotate(-90deg);
transition: transform 0.3s ease; /* 添加平滑过渡效果 */
}
.el-icon-caret-bottom {
transition: transform 0.3s ease;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<d2-dialog title="选择品牌" :is-visible="dialogVisible" class="brand-dialog" width="60%" @closeDialog="handleClose" <d2-dialog title="选择品牌" :is-visible="dialogVisible" class="brand-dialog" width="50%" @closeDialog="handleClose"
@confirmDialog="handleConfirm"> @confirmDialog="handleConfirm">
<el-form :inline="true" size="mini" class="demo-form-inline"> <el-form :inline="true" size="mini" class="demo-form-inline">
<el-form-item label="品牌名称:"> <el-form-item label="品牌名称:">
...@@ -172,8 +172,8 @@ export default { ...@@ -172,8 +172,8 @@ export default {
background: #ffffff; background: #ffffff;
height: 324px; height: 324px;
overflow-y: auto; overflow-y: auto;
width: 600px; width: 100%;
margin-right: 20px; // margin-right: 20px;
.tree-title { .tree-title {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -135,7 +135,18 @@ ...@@ -135,7 +135,18 @@
class="info-item" class="info-item"
> >
<span class="item-label">{{ item.label }}:</span> <span class="item-label">{{ item.label }}:</span>
<span>{{ detailInfo[item.name] || "-" }}</span> <!-- <span>{{ detailInfo[item.name] || "-" }}</span> -->
<template v-if="item.tooltip">
<template v-if="detailInfo[item.name]">
<el-tooltip class="item" effect="dark" :content="detailInfo[item.name]" placement="top-start">
<span class="max-width">{{ detailInfo[item.name] }}</span>
</el-tooltip>
</template>
<template v-else><span>-</span></template>
</template>
<template v-else>
<span>{{ detailInfo[item.name] || "-" }}</span>
</template>
</div> </div>
<block <block
v-for="(item, index) in busiInfoAttrObj.dynamic" v-for="(item, index) in busiInfoAttrObj.dynamic"
...@@ -369,7 +380,8 @@ export default { ...@@ -369,7 +380,8 @@ export default {
fixed: [ fixed: [
{ {
label: "退款子项", label: "退款子项",
name: "refundSubOrderCode" name: "refundSubOrderCode",
tooltip: true
}, },
{ {
label: "可退总价", label: "可退总价",
...@@ -857,6 +869,14 @@ export default { ...@@ -857,6 +869,14 @@ export default {
} }
} }
} }
.max-width {
display: inline-block;
white-space: nowrap; /* 禁止文本换行 */
overflow: hidden; /* 超出内容隐藏 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
max-width: 290px;
vertical-align: middle;
}
</style> </style>
<style> <style>
......
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="商品名称:"> <el-form-item label="商品名称:">
{{ detailInfo.goodsName ? detailInfo.goodsName : "-" }} <el-tooltip class="item" effect="dark" :content="detailInfo.goodsName" placement="top-start">
<div class="max-width">{{ detailInfo.goodsName ? detailInfo.goodsName : "-" }}</div>
</el-tooltip>
</el-form-item></el-col </el-form-item></el-col
> >
...@@ -66,7 +68,7 @@ ...@@ -66,7 +68,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item
:label=" :label="
detailInfo.failType == '退款' ? '退回积分' : '积分收益:' detailInfo.failType == '退款' ? '退回积分:' : '积分收益:'
" "
class="halfItem" class="halfItem"
> >
...@@ -171,7 +173,9 @@ ...@@ -171,7 +173,9 @@
v-if="detailInfo.status == '已失效'" v-if="detailInfo.status == '已失效'"
> >
<el-form-item label="退款子订单信息:" class="halfItem"> <el-form-item label="退款子订单信息:" class="halfItem">
{{ detailInfo.refundSubOrderCode ? detailInfo.refundSubOrderCode : "-" }} <el-tooltip class="item" effect="dark" :content="detailInfo.refundSubOrderCode" placement="top-start">
<div class="max-width">{{ detailInfo.refundSubOrderCode ? detailInfo.refundSubOrderCode : "-" }}</div>
</el-tooltip>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -531,6 +535,12 @@ export default { ...@@ -531,6 +535,12 @@ export default {
justify-content: center; justify-content: center;
margin-top: 20px; margin-top: 20px;
} }
.max-width {
white-space: nowrap; /* 禁止文本换行 */
overflow: hidden; /* 超出内容隐藏 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
max-width: 150px;
}
</style> </style>
<style> <style>
......
...@@ -152,7 +152,7 @@ export default { ...@@ -152,7 +152,7 @@ export default {
) { ) {
callback(new Error("输入的积分超过当前订单最大积分")) callback(new Error("输入的积分超过当前订单最大积分"))
} else if ( } else if (
value >= this.refundForm.remainingScore && value > this.refundForm.remainingScore &&
this.refundForm.refundType == 2 this.refundForm.refundType == 2
) { ) {
callback(new Error("输入的积分超过当前订单最大积分")) callback(new Error("输入的积分超过当前订单最大积分"))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!