|
@@ -24,7 +24,7 @@
|
|
|
<el-table-column type="index" label="序号" header-align="center" align="center">
|
|
<el-table-column type="index" label="序号" header-align="center" align="center">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
- <el-table-column align="center" min-width="100px" label="商品名称" prop="name">
|
|
|
|
|
|
|
+ <el-table-column align="center" min-width="200px" label="商品名称" prop="name">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column align="center" min-width="120px" label="商品编号" prop="seq">
|
|
<el-table-column align="center" min-width="120px" label="商品编号" prop="seq">
|
|
@@ -51,8 +51,6 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column align="center" min-width="100px" label="商品所在地" prop="location">
|
|
<el-table-column align="center" min-width="100px" label="商品所在地" prop="location">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column align="center" min-width="150px" label="上架时间" prop="shelfTime">
|
|
|
|
|
- </el-table-column> -->
|
|
|
|
|
<el-table-column align="center" min-width="80px" label="商品状态">
|
|
<el-table-column align="center" min-width="80px" label="商品状态">
|
|
|
<template slot-scope="props">
|
|
<template slot-scope="props">
|
|
|
<span v-if="props.row.status == 1">上架</span>
|
|
<span v-if="props.row.status == 1">上架</span>
|
|
@@ -64,6 +62,7 @@
|
|
|
<span @click="handleView(props.row)" style="color:green;cursor: pointer;">查看</span>
|
|
<span @click="handleView(props.row)" style="color:green;cursor: pointer;">查看</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <!-- fixed="right" -->
|
|
|
<el-table-column align="center" label="操作" width="240px" class-name="small-padding fixed-width">
|
|
<el-table-column align="center" label="操作" width="240px" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
<el-button type="primary" size="small" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
@@ -131,13 +130,14 @@
|
|
|
<!-- 添加或修改对话框 -->
|
|
<!-- 添加或修改对话框 -->
|
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="70%">
|
|
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="70%">
|
|
|
<el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="100px" style='width:700px; margin-left:50px;'>
|
|
<el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="100px" style='width:700px; margin-left:50px;'>
|
|
|
|
|
+ <el-form-item label="商品编号" prop="seq">
|
|
|
|
|
+ <el-input disabled placeholder="添加成功后自动生成" readonly v-model="dataForm.seq"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="商品名称" prop="name">
|
|
<el-form-item label="商品名称" prop="name">
|
|
|
<el-input v-model="dataForm.name"></el-input>
|
|
<el-input v-model="dataForm.name"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
- <el-form-item label="商品编号" prop="seq">
|
|
|
|
|
- <el-input placeholder="添加成功后自动生成" readonly v-model="dataForm.seq"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
<el-form-item label="商品属性" prop="productAttribute">
|
|
<el-form-item label="商品属性" prop="productAttribute">
|
|
|
<el-select v-model="dataForm.productAttribute" filterable placeholder="请选择" style="width: 350px"
|
|
<el-select v-model="dataForm.productAttribute" filterable placeholder="请选择" style="width: 350px"
|
|
@@ -153,19 +153,12 @@
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
-
|
|
|
|
|
- <el-form-item label="商品所在地" prop="location">
|
|
|
|
|
|
|
+ <el-form-item v-if="dataForm.productAttribute==1" label="商品所在地" prop="location">
|
|
|
<el-select v-model="dataForm.location" filterable placeholder="请选择" style="width: 350px">
|
|
<el-select v-model="dataForm.location" filterable placeholder="请选择" style="width: 350px">
|
|
|
<el-option :key="item.index" v-for="item in locationList" :label="item" :value="item">
|
|
<el-option :key="item.index" v-for="item in locationList" :label="item" :value="item">
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item v-if="dataForm.deliveryType==0" label="商品所在地" prop="location">
|
|
|
|
|
- <el-select v-model="dataForm.location" filterable placeholder="请选择" style="width: 350px">
|
|
|
|
|
- <el-option :key="item.index" v-for="item in locationList" :label="item" :value="item">
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item> -->
|
|
|
|
|
<el-form-item style="width: 800px" label="商品图片" prop="imgUrl">
|
|
<el-form-item style="width: 800px" label="商品图片" prop="imgUrl">
|
|
|
<el-tooltip content="建议图片宽高比260*200" placement="top-start">
|
|
<el-tooltip content="建议图片宽高比260*200" placement="top-start">
|
|
|
<el-upload :limit="1" :action="fileImgUrl" list-type="picture-card" :file-list="dataForm.images"
|
|
<el-upload :limit="1" :action="fileImgUrl" list-type="picture-card" :file-list="dataForm.images"
|
|
@@ -182,6 +175,13 @@
|
|
|
<el-form-item label="库存量" prop="actualStock">
|
|
<el-form-item label="库存量" prop="actualStock">
|
|
|
<el-input-number :precision="0" :step="1" v-model="dataForm.actualStock"></el-input-number>
|
|
<el-input-number :precision="0" :step="1" v-model="dataForm.actualStock"></el-input-number>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ style="width: 800px"
|
|
|
|
|
+ label="商品说明"
|
|
|
|
|
+ prop="content"
|
|
|
|
|
+ >
|
|
|
|
|
+ <tinymce v-model="dataForm.content" ref="tinymce"></tinymce>
|
|
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogFormVisible = false">取消</el-button>
|
|
<el-button @click="dialogFormVisible = false">取消</el-button>
|
|
@@ -298,13 +298,13 @@ export default {
|
|
|
actualStock: [{ required: true, message: "请设置库存量", trigger: "blur" }],
|
|
actualStock: [{ required: true, message: "请设置库存量", trigger: "blur" }],
|
|
|
deliveryType: [{ required: true, message: "请选择兑换方式", trigger: "blur" }],
|
|
deliveryType: [{ required: true, message: "请选择兑换方式", trigger: "blur" }],
|
|
|
location: [{ required: true, message: "请选择商品所在地", trigger: "blur" }],
|
|
location: [{ required: true, message: "请选择商品所在地", trigger: "blur" }],
|
|
|
|
|
+ content: [{ required: true, message: "说明不能为空", trigger: "blur" }],
|
|
|
},
|
|
},
|
|
|
dialogListVisible: false,
|
|
dialogListVisible: false,
|
|
|
fileImgUrl: this.upLoadUrl,
|
|
fileImgUrl: this.upLoadUrl,
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- // this.getCompanyTypeList();
|
|
|
|
|
this.getDepTypeList();
|
|
this.getDepTypeList();
|
|
|
this.getList();
|
|
this.getList();
|
|
|
},
|
|
},
|
|
@@ -375,6 +375,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
resetForm() {
|
|
resetForm() {
|
|
|
this.dataForm = {
|
|
this.dataForm = {
|
|
|
|
|
+ content: undefined,
|
|
|
name: undefined,
|
|
name: undefined,
|
|
|
seq: undefined,
|
|
seq: undefined,
|
|
|
productAttribute: undefined,
|
|
productAttribute: undefined,
|
|
@@ -393,6 +394,7 @@ export default {
|
|
|
this.dialogStatus = "create";
|
|
this.dialogStatus = "create";
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.tinymce.setContent("");
|
|
|
this.$refs["dataForm"].clearValidate();
|
|
this.$refs["dataForm"].clearValidate();
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -419,6 +421,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
|
this.dataForm = Object.assign({}, row);
|
|
this.dataForm = Object.assign({}, row);
|
|
|
|
|
+ let content = this.dataForm.content;
|
|
|
if (row.productAttribute == 1) {
|
|
if (row.productAttribute == 1) {
|
|
|
this.deliveryTypeList = [
|
|
this.deliveryTypeList = [
|
|
|
{
|
|
{
|
|
@@ -455,6 +458,7 @@ export default {
|
|
|
this.dialogStatus = 'update'
|
|
this.dialogStatus = 'update'
|
|
|
this.dialogFormVisible = true
|
|
this.dialogFormVisible = true
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.tinymce.setContent(content);
|
|
|
this.$refs['dataForm'].clearValidate()
|
|
this.$refs['dataForm'].clearValidate()
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|