商品编辑

master
feijinping 3 years ago
parent ace978346d
commit e465fb0b99

@ -1,4 +1,6 @@
export const dict_types = ["sys_user_sex",
"sys_show_hide", "sys_normal_disable", "sys_job_status", "sys_job_group", "sys_yes_no", "sys_notice_type", "sys_notice_status",
"sys_oper_type", "sys_common_status", "wms_item_type", "wms_carrier_level", "wms_supplier_level", "wms_receipt_type", "wms_receipt_status",
"wms_shipment_type", "wms_shipment_status", "wms_movement_type", "wms_movement_status"];
"wms_shipment_type", "wms_shipment_status", "wms_movement_type", "wms_movement_status",
"pms_publish_status"
];

@ -1,6 +1,6 @@
<template lang="pug">
el-select(v-model="value1")
el-option(v-for="it in options" :key="it.id" :value="it.id") {{it.name}}
el-option(v-for="it in options" :key="it.id" :value="it.id" :label="it.name") {{it.name}}
</template>
<script>

@ -11,10 +11,11 @@
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {mapGetters} from "vuex";
export default {
name: "ProdCategory",
components: {Treeselect},
props: ['value'],
props: ['value', 'root'],
computed: {
...mapGetters(['productCategories']),
value1: {
@ -47,7 +48,10 @@ export default {
p.children = map[p.id];
stack.push(...map[p.id])
}
return [{id: 0, label: '根节点', children: map['0']}];
if (this.root) {
return [{id: 0, label: '根节点', children: map['0']}];
}
return map['0'];
}
},
created() {

@ -1,6 +1,6 @@
<template lang="pug">
.add-product-wrapper
el-form(
el-form.content(
label-width="108px"
:model="form"
ref="form"
@ -15,11 +15,11 @@
el-form-item(label="商品名称" prop="name")
el-input(v-model="form.name" placeholder="请输入商品名称")
el-form-item(label="主图" prop="pic")
el-input(v-model="form.pic" placeholder="请输入主图")
image-upload(v-model="form.pic" :limit="1")
el-form-item(label="商品图片" prop="albumPics")
el-input(v-model="form.albumPics" placeholder="商品图片连产品图片限制为5张以逗号分割")
image-upload(v-model="form.albumPics" :limit="5")
el-form-item(label="上架状态")
dict-select(v-model="form.publishStatus")
dict-select(v-model="form.publishStatus" prop-name="pms_publish_status" )
el-form-item(label="排序" prop="sort")
el-input(v-model="form.sort" placeholder="请输入排序")
el-form-item(label="价格" prop="price")
@ -28,6 +28,8 @@
el-input(v-model="form.unit" placeholder="请输入单位")
el-form-item(label="商品重量" prop="weight")
el-input(v-model="form.weight" placeholder="商品重量,默认为克")
el-form-item(label="规格")
el-form-item(label="产品详情网页内容" prop="detailHtml")
el-input(
v-model="form.detailHtml"
@ -40,7 +42,7 @@
placeholder="请输入内容"
type="textarea"
)
div
.tc
el-button(type="primary" @click="submitForm")
el-button(@click="cancel")
</template>
@ -68,6 +70,10 @@ export default {
methods: {
getInfo(id) {
getPmsProduct(id).then(response => {
const {albumPics } = response
if (albumPics) {
response.albumPics = albumPics.split(',')
}
this.form = response;
});
},
@ -101,4 +107,8 @@ export default {
<style lang="stylus">
.add-product-wrapper
padding 12px
.content
margin 0 auto
width 75%
min-width 800px
</style>

@ -92,7 +92,7 @@
<el-dialog :title="title" :visible.sync="open" width="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two">
<el-form-item label="上级分类" prop="parentId">
<prod-category v-model="form.parentId"/>
<prod-category class="w200" v-model="form.parentId" :root="true"/>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="名称"/>

Loading…
Cancel
Save