Commit ffb967cb by cwq0219

产品编辑,商品编辑

1 parent 5fd4a312
......@@ -67,4 +67,10 @@ $prefix: d2;
position: absolute;
bottom: 9%;
right: 20px;
}
.edit-title {
margin-left: 10px;
color: #333333;
font-weight: bold;
}
\ No newline at end of file
......@@ -37,7 +37,7 @@ export default {
type: Object,
default: null
},
showBtnId: {
showBtnName: {
type: Array,
default: []
},
......@@ -54,7 +54,7 @@ export default {
* mapping 非必填 但: 当列表中的操作选项 根据 某个字段 变化的话 必填 且 必须 注明 field: 字段名
* label 当传入label 字段时 标识明确指定渲染该label 的按钮
* size 按钮样式,默认mini
* showBtnId 按需显示按钮
* showBtnName 按需显示按钮
*/
const {
category,
......@@ -62,7 +62,7 @@ export default {
mapping,
label,
size,
showBtnId
showBtnName
} = ctx.props
let curBtns = []
/**
......@@ -94,7 +94,7 @@ export default {
* 循环最终显示的按钮列表
* 并渲染到页面
*/
curBtns = showBtnId.length ? curBtns.filter(item => showBtnId.includes(item.authId)) : curBtns
curBtns = showBtnName.length ? curBtns.filter(item => showBtnName.includes(item.label)) : curBtns
curBtns.forEach(btn => {
__aBtns.push(h('el-button', {
props: {
......
<!-- 表单 -->
<template>
<d2-container class="d2-form">
<div class="d2-form">
<el-form
:model="formData"
:rules="rules"
......@@ -332,15 +332,23 @@
v-show="item.unit"
class="item-unit"
>{{item.unit}}</span>
<span
<div
v-show="item.tips"
class="item-tips"
>{{item.tips}}</span>
>
<template v-if="Array.isArray(item.tips)">
<p v-for="(x, y) in item.tips" :key="y">{{x}}</p>
</template>
<span v-else>{{item.tips}}</span>
</div>
</div>
<span v-if="headImg.isHas"><img
<span v-if="headImg.isHas && formData[headImg.attr]">
<img
class="commodity-img"
:src="formData[headImg.attr]"
/></span>
alt="图片"
/>
</span>
</div>
<el-form-item>
<el-button
......@@ -382,7 +390,7 @@
alt="图片"
>
</el-dialog>
</d2-container>
</div>
</template>
<script>
......@@ -712,11 +720,36 @@ export default {
</script>
<style>
.d2-form .title {
/* .d2-form .title {
height: 30px;
line-height: 30px;
padding-left: 20px;
background-color: #e1e0e0;
} */
.d2-form .title {
height: 30px;
line-height: 30px;
font-size: 12px;
color: #cccccc;
text-align: center;
margin: 30px 0;
}
.d2-form .title::before {
content: '';
display: inline-block;
width: 40%;
height: 1px;
padding-bottom: -10px;
border-bottom: 0.5px dotted #cccccc;
margin: 0 20px 3px 0;
}
.d2-form .title::after {
content: '';
display: inline-block;
width: 42%;
height: 1px;
border-bottom: 0.5px dotted #cccccc;
margin: 0 0 3px 20px;
}
.d2-form .dis-in-block {
display: inline-block;
......@@ -725,9 +758,11 @@ export default {
margin-left: 10px;
}
.d2-form .item-tips {
display: inline-block;
font-size: 12px;
color: #999999;
margin-left: 20px;
margin-left: 10px;
vertical-align: top;
}
.d2-form .icon-delete {
margin-left: 10px;
......@@ -739,7 +774,7 @@ export default {
margin: 0 6px;
}
.d2-form .photo-top-tips {
height: 36px;
/* height: 36px; */
margin: 0 0;
color: #999999;
}
......@@ -754,7 +789,7 @@ export default {
color: #999999;
border: 1px dashed #d9d9d9;
cursor: pointer;
margin-right: 10px;
/* margin-right: 10px; */
}
.d2-form .activity-Input {
......@@ -876,7 +911,7 @@ export default {
height: 200px;
position: absolute;
right: 58px;
top: 80px;
top: 118px;
}
</style>
......@@ -187,7 +187,7 @@ export const resources = {
name: 'editProduct',
icon: 'document',
meta: {
title: '产品编辑',
title: '素材编辑',
authId: '90304',
parentId: '90301',
cache: true,
......
<!-- 客户预录 -->
<template>
<d2-container>
<p><i class="el-icon-edit-outline"></i><span class="cus-title">预录客户</span></p>
<p><i class="el-icon-edit-outline"></i><span class="edit-title">预录客户</span></p>
<el-form
ref="editCusFrom"
class="editCusFrom"
......@@ -765,12 +765,6 @@ export default {
height: 80px;
}
.cus-title {
margin-left: 10px;
color: #333333;
font-weight: bold;
}
.editCusFrom .title {
height: 30px;
line-height: 30px;
......
......@@ -38,7 +38,7 @@
<auth-button
category="Button"
style="{display: inline-block}"
showBtnId="[9020201]"
showBtnName="['预录客户']"
></auth-button>
<span>已预录客户列表xx条记录。</span>
</span>
......@@ -46,7 +46,7 @@
<span class="btn-tips"><i class="el-icon-warning"></i>所有号码已启用隐私号码保护功能!</span>
<auth-button
category="Button"
showBtnId="[9020202]"
showBtnName="['一键导入']"
></auth-button>
</span>
</d2-table-header>
......
......@@ -25,8 +25,17 @@
</div>
</div>
<d2-table-header>
<span slot="left">
<auth-button
category="Button"
style="{display: inline-block}"
showBtnName="['新增商品']"
></auth-button>
</span>
<auth-button
category="Button"
style="{display: inline-block}"
showBtnName="['导出']"
></auth-button>
</d2-table-header>
<d2-table
......
<!-- 商品编辑 -->
<template>
<d2-container class="edit-commodity">
<p><i class="el-icon-edit-outline"></i><span class="edit-title">{{addOrEdit === 'add' ? '新增商品' : '编辑商品'}}</span></p>
<d2-form
v-if="show"
ref="d2Form"
......@@ -218,13 +219,13 @@ export default {
if (this.addOrEdit === 'edit') {
params.id = data.id
baseGoodsUpdate(params).then(res => {
console.log(res)
// console.log(res)
this.notice.okTips()
this.handleAddClose()
})
} else {
baseGoodsAdd(params).then(res => {
console.log(res)
// console.log(res)
this.notice.okTips()
this.handleAddClose(true)
})
......
<!-- 产品编辑 -->
<!-- 产品编辑(素材管理) -->
<template>
<d2-container class="edit-product">
<p><i class="el-icon-edit-outline"></i><span class="edit-title">{{addOrEdit === 'add' ? '新增素材' : '编辑素材'}}</span></p>
<d2-form
v-if="show"
ref="d2ProductForm"
......@@ -28,7 +29,7 @@ export default {
show: false,
addOrEdit: 'add',
rules: {
goodsName: [{ required: true, message: '请输入产品名称', trigger: 'change' }],
goodsName: [{ required: true, message: '请输入素材名称', trigger: 'change' }],
goodsType: [{ required: true, message: '请选择分类', trigger: 'change' }],
// thumbUrl: [{ required: true, message: '请选择缩略图', trigger: 'change' }],
thumbUrlList: [{ required: true, message: '请选择缩略图', trigger: 'blur' }],
......@@ -52,10 +53,10 @@ export default {
},
proFormRef: 'pro',
editForm: [{
title: '产品基本信息',
title: '素材基本信息',
formBlock: [{
name: 'goodsName',
label: '产品名称',
label: '素材名称',
type: 'input',
maxlength: 32
}, {
......@@ -87,13 +88,13 @@ export default {
name: 'thumbUrlList',
label: '缩略图',
type: 'photo',
topTips: '用于在小程序主页的商品列表展示',
tips: ['注:用于小程序主页商品列表配图展示', '请上传2M以内的jpg、jpeg、png图片,建议图片尺寸256*256'],
maxPhotoNum: 1
}, {
name: 'goodsImgList',
label: '产品主图',
type: 'photo',
topTips: '用于在小程序商品详情页的顶部展示',
tips: ['注:用于在小程序商品详情页的顶部展示'],
maxPhotoNum: 10
}, {
name: 'goodsDescList',
......
......@@ -29,13 +29,13 @@
<auth-button
category="Button"
style="{display: inline-block}"
showBtnId="[9030101]"
showBtnName="['新增素材']"
></auth-button>
</span>
<auth-button
category="Button"
style="{display: inline-block}"
showBtnId="[9030103]"
showBtnName="['导出']"
></auth-button>
</d2-table-header>
<d2-table
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!