This commit is contained in:
悠悠小鹿
2023-03-03 11:36:00 +08:00
parent d8b675fbe6
commit d41d5d1015
49 changed files with 7568 additions and 24897 deletions

View File

@@ -0,0 +1,195 @@
<template>
<el-dialog title="选择商品" center :visible.sync="visible" :before-close="handleClose">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button type="primary" @click="sedSelectPro"> </el-button>
</el-form-item>
</el-form>
<el-table ref="multipleTable"
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column label="序号" width="70" align="center">
<template slot-scope="scope">
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column
prop="productName"
header-align="center"
align="center"
label="商品名称">
</el-table-column>
<el-table-column
prop="price"
header-align="center"
align="center"
label="商品价格">
</el-table-column>
<el-table-column header-align="center" align="center" label="商品图">
<template slot-scope="scope">
<img v-if="scope.row.productImages != ''" :src="scope.row.productImages" width="30" height="30" class="tableImg" />
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-dialog>
</template>
<script>
export default {
props: {
visible: {
type: Boolean,
value: false
},
deliverOrder: {
type: Object,
value: {}
}
},
data() {
return {
dataForm:{
key:''
},
selectTitle:'',
oldSelected:[],
dataList: [],
pageIndex: 1,
pageSize: 20,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
}
},
create(){
},
mounted(){
// console.log(454545)
this.$bus.$on("ProListVisible", (val) => {
this.visible = true
});
this.$bus.$on("getListInMes", (data) => {
this.selectTitle = data.selectTitle
this.oldSelected = data.ProductList
});
},methods:{
// 判断初始选中的产品
check(){
console.log(this.oldSelected,'check')
if(this.oldSelected.length > 0){
this.dataList.forEach((item) => {
this.oldSelected.forEach((item2) => {
if(item.productId == item2.productId){
this.dataListSelections.push(item)
this.$refs.multipleTable.toggleRowSelection(item)
}
})
})
console.log(this.dataListSelections, 'dataListSelections')
}
},
handleClose(){
this.$emit("ProListClose", false);
},
sedSelectPro(){
console.log(this.dataListSelections)
this.$bus.$emit('haveSelected', {title:this.selectTitle,list:this.dataListSelections})
this.handleClose()
},
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/book/shopproduct/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
// console.log(data)
this.dataList = data.page.list
this.totalPage = data.page.totalCount
this.$nextTick(()=> {
this.check() // 获取到已选中的数据
})
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
}
}
</script>
<style lang="less" scoped>
.el-form-item__label {
font-size: 12px;
}
.el-uploadfeng {
/deep/ .el-upload-list__item {
width: 300px;
height: 150px;
}
/deep/ .el-upload--picture-card {
width: 60px;
height: 60px;
line-height: 70px;
}}
.pictureList{
/deep/.el-upload--picture{ display: none;}
/deep/ .el-upload-list{ display: flex; justify-content:space-between; flex-wrap: wrap;
.el-upload-list__item{
width:30%; padding: 5px 5px 5px 87px; height: 66px;
img{width: 54px; height: 54px;}
.el-upload-list__item-name{line-height: 54px;}
}
}
}
</style>

View File

@@ -1,201 +1,344 @@
<template>
<el-dialog
:title="!dataForm.productId ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible"
<el-dialog center :title="!dataForm.productId ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible"
@close="handlereset">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="所属分类" prop="productPid">
<el-cascader v-model="dataForm.poids" :options="categorys" :props="props" @change="handleChange" clearable></el-cascader>
</el-form-item>
<el-form-item label="商品名称" prop="productName">
<el-input v-model="dataForm.productName" placeholder="商品名称"></el-input>
</el-form-item>
<el-form-item label="商品价格" prop="price">
<el-input v-model="dataForm.price" placeholder="商品价格"></el-input>
</el-form-item>
<el-form-item label="商品重量" prop="weight">
<el-input v-model="dataForm.weight" placeholder="商品重量"></el-input>
</el-form-item>
<el-form-item label="上架状态" prop="publishStatus">
<el-input v-model="dataForm.publishStatus" placeholder="上架状态"></el-input>
</el-form-item>
<el-form-item label="商品图" prop="productImages">
<el-upload
action="http://59.110.212.44:9100/pb/oss/fileoss"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:file-list="fileList"
:on-success="handlePicSuccess"
:on-remove="handleRemove">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
<img width="100%" :src="dataForm.productImages" alt="">
</el-dialog>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item>
<el-form-item label="删除标记" prop="delFlag">
<el-input v-model="dataForm.delFlag" placeholder="删除标记"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item>
<el-steps :active="steps" simple style="margin-bottom: 15px;">
<el-step title="基本信息" icon="el-icon-edit"></el-step>
<el-step title="商品详情" icon="el-icon-upload"></el-step>
</el-steps>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="100px">
<div class="steps1" v-if="steps == 1">
<el-form-item label="所属分类" prop="productPid">
<el-cascader v-model="dataForm.poids" :options="categorys" :props="props" clearable></el-cascader>
</el-form-item>
<el-form-item label="商品类型" prop="goodsType">
<el-select v-model="dataForm.goodsType" placeholder="请选择">
<el-option v-for="item in goodsTypeList" :key="item.dictType" :label="item.dictValue" :value="item.dictType">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商品名称" prop="productName">
<el-input v-model="dataForm.productName" placeholder="商品名称"></el-input>
</el-form-item>
<el-form-item label="商品图" prop="productImages">
<el-upload :limit="dataForm.limitCountImg" class="el-uploadfeng noneBtnImg"
:class="{ uoloadSty: dataForm.showBtnDealImg, disUoloadSty: dataForm.noneBtnImg }"
action="http://59.110.212.44:9100/pb/oss/fileoss" list-type="picture-card"
:on-preview="handlePictureCardPreview" :file-list="fileList" :on-success="handlePicSuccess"
accept=".jpeg,.jpg,.gif,.png" :on-change="dealImgChange" :on-remove="handleRemove">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
<img width="100%" :src="dataForm.productImages" alt="">
</el-dialog>
</el-form-item>
<el-form-item label="商品轮播图" prop="productImageList">
<el-upload :limit="5" class="el-uploadfeng noneBtnImg"
:class="{ uoloadSty: dataForm.showBtnDealImg, disUoloadSty: dataForm.noneBtnImg }"
action="http://59.110.212.44:9100/pb/oss/fileoss" list-type="picture-card"
:on-preview="handlePictureCardPreview" :file-list="swiperfileList" :on-success="bannerHandlePicSuccess"
accept=".jpeg,.jpg,.gif,.png" :on-remove="bannerHandleRemove">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
<img width="100%" :src="dataForm.productImageList" alt="">
</el-dialog>
<span>图片尺寸600*600px支持图片类型.jpeg,.jpg,.gif,.png 最多上传5张图片</span>
</el-form-item>
<div>
<el-form-item label="商品价格" prop="price" style="width: 50%; float: left;">
<el-input v-model="dataForm.price" placeholder="商品价格"></el-input>
</el-form-item>
<el-form-item label="商品重量" prop="weight" style="width: 48%; float: right;">
<el-input style="width: 80%;" v-model="dataForm.weight" placeholder="商品重量"></el-input><span
style="display: inline-block; float: right; width: 10%;"></span>
</el-form-item>
</div>
<!-- <el-form-item label="上架状态" prop="publishStatus">
<el-input v-model="dataForm.publishStatus" placeholder="上架状态"></el-input>
</el-form-item> -->
<div>
<el-form-item label="出版社" prop="publisher" style="width: 50%; float: left;">
<el-input placeholder="出版社" v-model="dataForm.publisher"></el-input>
</el-form-item>
<el-form-item label="作者" prop="author" style="width: 48%; float: right;">
<el-input placeholder="作者" v-model="dataForm.author"></el-input>
</el-form-item>
</div>
<div>
<el-form-item label="出版时间" prop="pubDate" style="width: 50%; float: left;">
<el-date-picker @change="changed" format="yyyy 年 MM 月 dd 日" v-model="dataForm.pubDate" type="date" placeholder="选择日期时间">
</el-date-picker>
<!-- <el-input placeholder="出版时间" v-model=""></el-input> -->
</el-form-item>
<el-form-item label="页数" prop="pageNum" style="width: 48%; float: right;">
<el-input placeholder="页数" v-model="dataForm.pageNum"></el-input>
</el-form-item>
</div>
<div>
<el-form-item label="内文用纸材质" prop="quality" style="width: 50%; float: left;">
<el-input v-model="dataForm.quality" placeholder="内文用纸材质"></el-input>
</el-form-item>
<el-form-item label="开本" prop="format" style="width: 48%; float: right;">
<el-input v-model="dataForm.format" placeholder="16开或其他规格"></el-input>
</el-form-item>
</div>
<!-- <el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item> -->
</div>
<div></div>
<div class="steps2" v-if="steps == 2">
<div style="margin-bottom: 15px;"><b>商品详情</b></div>
<quill-editor v-model="dataForm.productDetails" ref="myQuillEditor" height:400px :options="editorOption"
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"
@ready="onEditorReady($event)">
</quill-editor>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handlereset">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<!-- <el-button @click="handlereset">取消</el-button> -->
<el-button type="warning" @click="steps = 1" plain size="mini">添加基本信息</el-button>
<el-button type="success" @click="steps = 2" plain size="mini">添加商品详情</el-button>
<el-button type="primary" @click="dataFormSubmit()" plain size="mini">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
categorys:'',
fileList:[],
dialogVisible: false,
props: {
import { quillEditor } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
export default {
data() {
return {
goodsTypeList: [],
steps: 1,
visible: false,
categorys: [],
fileList: [], // 封面图
swiperfileList: [],
dialogVisible: false,
props: {
value: "catId",
label: "name",
children: "children",
checkStrictly: true
},
dataForm: {
productId: 0,
productName: '',
price: '',
weight: '',
publishStatus: '',
productPid: '',
productImages: '',
createTime: '',
updateTime: '',
delFlag: '',
sort: '',
poids:[]
dataForm: {
productId: 0,
limitCountImg: 1, // 图片数量
productImageList: '', // 轮播图
showBtnDealImg: true,
noneBtnImg: false,
productName: '',
price: '',
author: '',
publisher: '',
weight: '',
pubDate: '',
format: '', // 开本
pageNum: null,
quality: '', // 内文用纸
sumSales: null, // 总销量
publishStatus: '',
productPid: '',
productImages: '',
createTime: '',
updateTime: '',
delFlag: '',
sort: '',
goodsType: '', // 商品类型
poids: []
},
dataRule: {
productName: [
{ required: true, message: '商品名称不能为空', trigger: 'blur' }
],
price: [
{ required: true, message: '商品价格不能为空', trigger: 'blur' }
],
weight: [
{ required: true, message: '商品重量不能为空', trigger: 'blur' }
],
goodsType: [
{ required: true, message: '商品类型不能为空', trigger: 'blur' }
],
productPid: [
{ required: true, message: '商品父id不能为空', trigger: 'blur' }
],
productImages: [
{ required: true, message: '商品图不能为空', trigger: 'blur' }
],
productDetails: [
{ required: true, message: '商品详情不能为空', trigger: 'blur' }
],
// createTime: [
// { required: true, message: '创建时间不能为空', trigger: 'blur' }
// ],
// updateTime: [
// { required: true, message: '更新时间不能为空', trigger: 'blur' }
// ],
// delFlag: [
// { required: true, message: '删除标记不能为空', trigger: 'blur' }
// ],
// sort: [
// { required: true, message: '排序不能为空', trigger: 'blur' }
// ]
},
// 富文本编辑器配置
editorOption: {
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
['blockquote', 'code-block'], // 引用 代码块
[{ header: 1 }, { header: 2 }], // 1、2 级标题
[{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
[{ script: 'sub' }, { script: 'super' }], // 上标/下标
[{ indent: '-1' }, { indent: '+1' }], // 缩进
[{ direction: 'rtl' }], // 文本方向
[{ size: ['12', '14', '16', '18', '20', '22', '24', '28', '32', '36'] }], // 字体大小
[{ header: [1, 2, 3, 4, 5, 6] }], // 标题
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
// [{ font: ['songti'] }], // 字体种类
[{ align: [] }], // 对齐方式
['clean'], // 清除文本格式
['image', 'video'] // 链接、图片、视频
]
},
dataRule: {
// productName: [
// { required: true, message: '商品名称不能为空', trigger: 'blur' }
// ],
// price: [
// { required: true, message: '商品价格不能为空', trigger: 'blur' }
// ],
// weight: [
// { required: true, message: '商品重量不能为空', trigger: 'blur' }
// ],
// publishStatus: [
// { required: true, message: '上架状态不能为空', trigger: 'blur' }
// ],
// productPid: [
// { required: true, message: '商品父id不能为空', trigger: 'blur' }
// ],
// productImages: [
// { required: true, message: '商品图不能为空', trigger: 'blur' }
// ],
// level: [
// { required: true, message: '层级不能为空', trigger: 'blur' }
// ],
// createTime: [
// { required: true, message: '创建时间不能为空', trigger: 'blur' }
// ],
// updateTime: [
// { required: true, message: '更新时间不能为空', trigger: 'blur' }
// ],
// delFlag: [
// { required: true, message: '删除标记不能为空', trigger: 'blur' }
// ],
// sort: [
// { required: true, message: '排序不能为空', trigger: 'blur' }
// ]
}
}
},
created (){
this.getTreeList()
},
methods: {
init (id) {
this.dataForm.productId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.productId) {
this.$http({
url: this.$http.adornUrl(`/book/shopproduct/info/${this.dataForm.productId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.productName = data.shopProduct.productName
this.dataForm.price = data.shopProduct.price
this.dataForm.weight = data.shopProduct.weight
this.dataForm.publishStatus = data.shopProduct.publishStatus
this.dataForm.productPid = data.shopProduct.productPid
this.dataForm.productImages = data.shopProduct.productImages
this.dataForm.createTime = data.shopProduct.createTime
this.dataForm.updateTime = data.shopProduct.updateTime
this.dataForm.delFlag = data.shopProduct.delFlag
this.dataForm.sort = data.shopProduct.sort
this.dataForm.poids = data.shopProduct.poids
if (data.shopProduct.productImages != "") {
placeholder: '请输入正文'
},
}
},
created() {
this.getTreeList()
},
methods: {
init(id) {
this.dataForm.productId = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.productId) {
this.$http({
url: this.$http.adornUrl(`/book/shopproduct/info/${this.dataForm.productId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm.productName = data.shopProduct.productName
this.dataForm.price = data.shopProduct.price
this.dataForm.goodsType = data.shopProduct.goodsType
this.dataForm.weight = data.shopProduct.weight
this.dataForm.publishStatus = data.shopProduct.publishStatus
this.dataForm.productPid = data.shopProduct.productPid
this.dataForm.productImages = data.shopProduct.productImages
this.dataForm.createTime = data.shopProduct.createTime
this.dataForm.updateTime = data.shopProduct.updateTime
this.dataForm.delFlag = data.shopProduct.delFlag
this.dataForm.sort = data.shopProduct.sort
this.dataForm.pubDate = data.shopProduct.pubDate
this.dataForm.productDetails = data.shopProduct.productDetails
this.dataForm.poids = data.shopProduct.poids
if (data.shopProduct.productImages != "") {
var img = { name: '', url: data.shopProduct.productImages }
var attr = []
attr.push(img)
this.fileList = attr
}
if (data.shopProduct.productImageList == null || data.shopProduct.productImageList[0] == '' || data.shopProduct.productImageList == "") {
return this.swiperfileList = []
}else{
// 有轮播图
console.log(data.shopProduct.productImageList)
let arr = []
let arr1 = []
arr = data.shopProduct.productImageList.split(',');
console.log(arr)
arr.forEach((item, index) => {
arr1.push({ name: index, url: item })
});
this.swiperfileList = arr1
}
}
})
}
})
},
// 获取商品类型
getGoodsTypeList() {
this.$http({
url: this.$http.adornUrl('/book/sysdictdata/selectByType/goodsType'),
method: 'get',
}).then(({ data }) => {
console.log(data.dataList)
this.goodsTypeList = data.dataList
})
},
dealImgChange(file, fileList) {
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
this.dataForm.productImageList = this.getStringImgUrl()
// console.log(this.dataForm.productImageList)
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/shopproduct/${!this.dataForm.productId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'productId': this.dataForm.productId || undefined,
'productName': this.dataForm.productName,
'price': this.dataForm.price,
'weight': this.dataForm.weight,
'publishStatus': this.dataForm.publishStatus,
'productPid': this.dataForm.poids[this.dataForm.poids.length - 1],
'productImages': this.dataForm.productImages,
'productImageList': this.dataForm.productImageList,
'createTime': this.dataForm.createTime,
'updateTime': this.dataForm.updateTime,
'delFlag': this.dataForm.delFlag,
'sort': this.dataForm.sort,
'goodsType': this.dataForm.goodsType,
'productDetails': this.dataForm.productDetails,
'author': this.dataForm.author,
'publisher': this.dataForm.publisher,
'pubDate': this.dataForm.pubDate,
'format': this.dataForm.format, // 开本
'pageNum': this.dataForm.pageNum,
'quality': this.dataForm.quality, // 内文用纸
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/book/shopproduct/${!this.dataForm.productId ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'productId': this.dataForm.productId || undefined,
'productName': this.dataForm.productName,
'price': this.dataForm.price,
'weight': this.dataForm.weight,
'publishStatus': this.dataForm.publishStatus,
'productPid': this.dataForm.poids[this.dataForm.poids.length-1],
'productImages': this.dataForm.productImages,
'createTime': this.dataForm.createTime,
'updateTime': this.dataForm.updateTime,
'delFlag': this.dataForm.delFlag,
'sort': this.dataForm.sort
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
},
getTreeList() {
} else {
this.$message.error(data.msg)
}
})
}
})
},
changed(e){
console.log(e)
},
getTreeList() {
this.$http({
url: this.$http.adornUrl(`/book/shopcategory/listTree`),
method: 'get',
@@ -208,21 +351,104 @@
this.dataForm.productImages = file.url;
this.dialogVisible = true;
},
handlePicSuccess(res, file) {
bannerHandlePicSuccess(res, file) {
// 轮播图上传成功
if (res.msg == "success") {
this.dataForm.productImages = res.url;
this.swiperfileList.push({ name: file.name, url: res.url })
console.log(this.swiperfileList)
this.$message.success("上传成功");
} else {
this.$message.error("上传失败");
}
},
handleRemove(file) {
// 字符串图片地址
getStringImgUrl() {
let arr = this.swiperfileList.map(item => item.url)
if(arr.length <= 0){
return null
}else{
return arr.toString()
}
},
handlePicSuccess(res, file) {
if (res.msg == "success") {
this.dataForm.productImages = res;
this.$message.success("上传成功");
} else {
this.$message.error("上传失败");
}
},
bannerHandleRemove(file, fileList) {
// 轮播图删除操作
this.swiperfileList = fileList
},
handleRemove(file, fileList) {
this.dataForm.productImages = '';
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
},
handlereset(){
handlereset() {
this.fileList = [],
this.visible = false
this.visible = false
},
// 失去焦点事件
onEditorBlur(quill) {
console.log('editor blur!', quill)
},
// 获得焦点事件
onEditorFocus(quill) {
console.log('editor focus!', quill)
},
// 准备富文本编辑器
onEditorReady(quill) {
console.log('editor ready!', quill)
},
// 内容改变事件
onEditorChange({ quill, html, text }) {
console.log('editor change!', quill, html, text)
this.content = html
}
},
components: {
quillEditor
},
watch: {
visible: {
handler(val, oldVal) {
this.getGoodsTypeList()
},
deep: true
},
}
}
</script>
<style></style>
<style lang="less" scoped>
.disUoloadSty {
.el-upload--picture-card {
display: none;
/* 上传按钮隐藏 */
}
}
.el-form-item {
/deep/ .el-form-item__label {
font-size: 12px;
}
}
.el-uploadfeng {
/deep/ .el-upload-list__item {
width: 60px;
height: 60px;
}
/deep/ .el-upload--picture-card {
width: 60px;
height: 60px;
line-height: 70px;
}
}
</style>

View File

@@ -26,15 +26,7 @@
<template slot-scope="scope">
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="publishStatus" header-align="center" align="center" label="状态">
<template slot-scope="scope">
<el-switch :active-value=1 :inactive-value=0 style="display: block" v-model="scope.row.publishStatus"
@change="SwitchChange(scope.row)" active-color="#13ce66" inactive-color="#ff4949" active-text="上架"
inactive-text="下架">
</el-switch>
</template>
</el-table-column>
</el-table-column>
<el-table-column
prop="productName"
header-align="center"
@@ -46,54 +38,12 @@
header-align="center"
align="center"
label="商品价格">
</el-table-column>
<el-table-column
prop="weight"
header-align="center"
align="center"
label="商品重量">
</el-table-column>
<!-- <el-table-column
prop="productPid"
header-align="center"
align="center"
label="商品父id">
</el-table-column> -->
</el-table-column>
<el-table-column header-align="center" align="center" label="商品图">
<template slot-scope="scope">
<img v-if="scope.row.productImages != ''" :src="scope.row.productImages" width="70" height="100" class="tableImg" />
</template>
</el-table-column>
<!-- <el-table-column
prop="level"
header-align="center"
align="center"
label="层级">
</el-table-column> -->
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<!-- <el-table-column
prop="delFlag"
header-align="center"
align="center"
label="删除标记">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column> -->
</el-table-column>
<el-table-column
fixed="right"
header-align="center"