Commit 38544e19 by lixiaomin

修改商品

parent 0779afc2
<template> <template>
<el-select <el-select
v-model="value" v-model="selectValue"
style="width: 100%" style="width: 100%"
@change="change" @change="change"
placeholder="请选择" placeholder="请选择分类"
clearable clearable
> >
<el-option <el-option
...@@ -28,7 +28,8 @@ export default { ...@@ -28,7 +28,8 @@ export default {
}, },
data() { data() {
return { return {
options: [], selectValue: this.value,
options: []
}; };
}, },
created() { created() {
......
...@@ -22,19 +22,19 @@ ...@@ -22,19 +22,19 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="制作时长" prop="takeTime"> <el-form-item label="制作时长" prop="takeTime">
<el-input v-model="form.takeTime" placeholder="请输入制作时长" /> <el-input v-model="form.takeTime" placeholder="请输入时长,单位秒" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="折扣价" prop="discount"> <el-form-item label="折扣价" prop="discount">
<el-input v-model="form.discount" placeholder="请输入折扣价" /> <el-input v-model="form.discount" placeholder="请输入折扣价,单位元" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="原价" prop="price"> <el-form-item label="原价" prop="price">
<el-input v-model="form.price" placeholder="请输入原价" /> <el-input v-model="form.price" placeholder="请输入原价,单位元" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -136,6 +136,30 @@ export default { ...@@ -136,6 +136,30 @@ export default {
}, },
components: { SelectCategory, SelectSpecs }, components: { SelectCategory, SelectSpecs },
data() { data() {
var validateThumbnail = (rule, value, callback) => {
let thumbnailValue=this.form.pics.thumbnail;
if (thumbnailValue == undefined || thumbnailValue === '') {
callback(new Error('请上传缩略图点单屏'));
}else {
callback();
}
};
var validateIntroImages = (rule, value, callback) => {
let introImagesValue=this.form.pics.introImages;
if (introImagesValue == undefined || introImagesValue === '') {
callback(new Error('请上传介绍图点单屏'));
}else {
callback();
}
};
var validateDetailImages = (rule, value, callback) => {
let detailImagesValue=this.form.pics.detailImages;
if (detailImagesValue == undefined || detailImagesValue === '') {
callback(new Error('请上传内容图点单屏'));
}else {
callback();
}
};
return { return {
title: "", title: "",
specNames: "", specNames: "",
...@@ -147,14 +171,16 @@ export default { ...@@ -147,14 +171,16 @@ export default {
open: false, open: false,
// 表单校验 // 表单校验
rules: { rules: {
spuName: [{ required: true, message: "不能为空", trigger: "blur" }], name: [{ required: true, message: "不能为空", trigger: "blur" }],
status: [ category: [{required: true, message: "不能为空", trigger: "blur" }],
{ spec: [{required: true, message: "不能为空", trigger: "blur" }],
required: true, takeTime: [{required: true, message: "不能为空", trigger: "blur" }],
message: "不能为空", discount: [{required: true, message: "不能为空", trigger: "blur" }],
trigger: "blur", price: [{required: true, message: "不能为空", trigger: "blur" }],
}, thumbnail:[{ required: true, validator: validateThumbnail, trigger: 'blur' }],
], introImages:[{required: true, validator: validateIntroImages,trigger: "blur" }],
detailImages:[{required: true, validator: validateDetailImages, trigger: "blur" }],
}, },
goodsTagList: [], goodsTagList: [],
inputVisible: false, inputVisible: false,
......
...@@ -60,6 +60,9 @@ ...@@ -60,6 +60,9 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['system:category:edit']">修改</el-button> -->
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-if="authBtn(['1', '2', '3', '4'], scope.row.state)">删除</el-button> v-if="authBtn(['1', '2', '3', '4'], scope.row.state)">删除</el-button>
<el-button size="mini" type="text" v-if="authBtn(['2', '4'], scope.row.state)" <el-button size="mini" type="text" v-if="authBtn(['2', '4'], scope.row.state)"
...@@ -109,15 +112,8 @@ export default { ...@@ -109,15 +112,8 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
spuName: null, spuName: null,
productionTime: null, state: null,
discountPrice: null, category: null
originalPrice: null,
label: null,
desc: null,
createUserId: null,
updateUserId: null,
shelfTime: null,
status: null,
}, },
options: [{ options: [{
value: '1', value: '1',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment