品牌、类别
This commit is contained in:
18
src/api/adminmallapi.js
Normal file
18
src/api/adminmallapi.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
// 品牌列表
|
||||
listAllBrand: function(params) {
|
||||
return request({
|
||||
url: '/adminapi/mall/listAllBrand',
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
// 品牌列表
|
||||
listAllCategory: function(params) {
|
||||
return request({
|
||||
url: '/adminapi/mall/listAllCategory',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -62,25 +62,27 @@
|
||||
},
|
||||
name: '/pms',
|
||||
path: '/pms',
|
||||
children: [{
|
||||
alwaysShow: true,
|
||||
component: 'product',
|
||||
meta: {
|
||||
icon: 'el-icon-help',
|
||||
title: '商品列表'
|
||||
},
|
||||
name: '/pms/product',
|
||||
path: '/pms/product'
|
||||
},
|
||||
{
|
||||
path: '/pms/addProduct',
|
||||
name: '/pms/addProduct',
|
||||
component: 'addProduct',
|
||||
meta: {
|
||||
title: '添加商品',
|
||||
icon: 'el-icon-help'
|
||||
}
|
||||
}, {
|
||||
children: [
|
||||
// {
|
||||
// alwaysShow: true,
|
||||
// component: 'product',
|
||||
// meta: {
|
||||
// icon: 'el-icon-help',
|
||||
// title: '商品列表'
|
||||
// },
|
||||
// name: '/pms/product',
|
||||
// path: '/pms/product'
|
||||
// },
|
||||
// {
|
||||
// path: '/pms/addProduct',
|
||||
// name: '/pms/addProduct',
|
||||
// component: 'addProduct',
|
||||
// meta: {
|
||||
// title: '添加商品',
|
||||
// icon: 'el-icon-help'
|
||||
// }
|
||||
// },
|
||||
{
|
||||
alwaysShow: true,
|
||||
component: 'brand',
|
||||
meta: {
|
||||
@@ -98,16 +100,17 @@
|
||||
},
|
||||
name: '/pms/productCate',
|
||||
path: '/pms/productCate'
|
||||
}, {
|
||||
alwaysShow: true,
|
||||
component: 'productAttr',
|
||||
meta: {
|
||||
icon: 'el-icon-help',
|
||||
title: '商品类型'
|
||||
},
|
||||
name: '/pms/productAttr',
|
||||
path: '/pms/productAttr'
|
||||
}
|
||||
// , {
|
||||
// alwaysShow: true,
|
||||
// component: 'productAttr',
|
||||
// meta: {
|
||||
// icon: 'el-icon-help',
|
||||
// title: '商品类型'
|
||||
// },
|
||||
// name: '/pms/productAttr',
|
||||
// path: '/pms/productAttr'
|
||||
// }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,85 +1,131 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>商品信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
<div class="tab-header webtop">
|
||||
<!-- 标题 -->
|
||||
<div>商品信息</div>
|
||||
<!-- start 添加修改按钮 -->
|
||||
<div>
|
||||
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||
</div>
|
||||
<!-- end 添加修改按钮 -->
|
||||
<!-- end 详情按钮 -->
|
||||
</div>
|
||||
|
||||
<div class="listconadd">
|
||||
<div class="listconadd">
|
||||
|
||||
<el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text">名称:</span>
|
||||
<el-input v-model="formobj.name" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">编码:</span>
|
||||
<el-input v-model="formobj.code" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">条码:</span>
|
||||
<el-input v-model="formobj.barcode" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^0-9]/g,'')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">价格 (元/斤):</span>
|
||||
<el-input v-model="formobj.price" placeholder="" class="item_input" clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="item_text">商品单位:</span>
|
||||
<el-input v-model="formobj.specificationUnit" placeholder="例如:斤/瓶/袋/箱/盒" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">规格 (斤/份):</span>
|
||||
<el-input v-model="formobj.weight" placeholder="例如:30" class="item_input" clearable oninput="value=value.replace(/[^0-9]/g,'')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">规格单位:</span>
|
||||
<el-input v-model="formobj.unitName" placeholder="例如:份" :readonly="true" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">规格描述:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="例如:一份30斤" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">商品简介:</span>
|
||||
<el-input v-model="formobj.content" placeholder="商品简介" class="item_input" clearable />
|
||||
</div>
|
||||
<el-card class="box-card">
|
||||
<div class="item">
|
||||
<span class="item_text">选择菜窖分类:</span>
|
||||
<el-select v-model="formobj.brandId" placeholder="请选择菜窖分类" class="item_input" @change="selectBrandChange">
|
||||
<el-option
|
||||
v-for="item in brandList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">选择商品分类:</span>
|
||||
<el-select v-model="formobj.categoryId" placeholder="请选择商品分类" class="item_input" @change="selectCateChange">
|
||||
<el-option
|
||||
v-for="item in cateList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">名称:</span>
|
||||
<el-input v-model="formobj.name" placeholder="" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">编码:</span>
|
||||
<el-input
|
||||
v-model="formobj.code"
|
||||
placeholder=""
|
||||
class="item_input"
|
||||
clearable
|
||||
oninput="value=value.replace(/[^A-Za-z0-9]/g, '')"
|
||||
/>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">条码:</span>
|
||||
<el-input
|
||||
v-model="formobj.barcode"
|
||||
placeholder=""
|
||||
class="item_input"
|
||||
clearable
|
||||
oninput="value=value.replace(/[^0-9]/g,'')"
|
||||
/>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">价格 (元/斤):</span>
|
||||
<el-input
|
||||
v-model="formobj.price"
|
||||
placeholder=""
|
||||
class="item_input"
|
||||
clearable
|
||||
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="item" style="margin-bottom: 100px;margin-top: 100px;">
|
||||
<span class="item_text">图片:</span>
|
||||
<upload style="margin-top: 20px;" class="item_input" ref="uploadImg2" v-model="imgList" :limit="1"
|
||||
@change="backData" bucket="map" :class="{ hide: hideUploadBtn }"
|
||||
:upload-data="{ type: '0001' }"></upload>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">商品单位:</span>
|
||||
<el-input v-model="formobj.specificationUnit" placeholder="例如:斤/瓶/袋/箱/盒" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">规格 (斤/份):</span>
|
||||
<el-input v-model="formobj.weight" placeholder="例如:30" class="item_input" clearable oninput="value=value.replace(/[^0-9]/g,'')" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">规格单位:</span>
|
||||
<el-input v-model="formobj.unitName" placeholder="例如:份" :readonly="true" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">规格描述:</span>
|
||||
<el-input v-model="formobj.remarks" placeholder="例如:一份30斤" class="item_input" clearable />
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="item_text">商品简介:</span>
|
||||
<el-input v-model="formobj.content" placeholder="商品简介" class="item_input" clearable />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="item_text">商品详情:</span>
|
||||
<editor :height="300" :minHeight="100" :value="formobj.appContent" @input="editinput"></editor>
|
||||
</div>
|
||||
<div class="item" style="margin-bottom: 100px;margin-top: 100px;">
|
||||
<span class="item_text">图片:</span>
|
||||
<upload
|
||||
ref="uploadImg2"
|
||||
v-model="imgList"
|
||||
style="margin-top: 20px;"
|
||||
class="item_input"
|
||||
:limit="1"
|
||||
bucket="map"
|
||||
:class="{ hide: hideUploadBtn }"
|
||||
:upload-data="{ type: '0001' }"
|
||||
@change="backData"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
<div>
|
||||
<span class="item_text">商品详情:</span>
|
||||
<editor :height="300" :min-height="100" :value="formobj.appContent" @input="editinput" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import req from '@/api/commodity/commodity.js'
|
||||
import upload from '@/components/uploadFile/upload_yanchejianchaTuBiao.vue'
|
||||
import Editor from '@/components/Editor'
|
||||
import reqMall from '@/api/adminmallapi.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -90,39 +136,54 @@
|
||||
return {
|
||||
imgList: [
|
||||
|
||||
|
||||
],
|
||||
submitdisabled: false,
|
||||
formobj: {
|
||||
sid: "",
|
||||
sid: '',
|
||||
name: '',
|
||||
code: '',
|
||||
barcode: '',
|
||||
price: "",
|
||||
unitName: "份",
|
||||
specificationUnit:"",
|
||||
weight:"",
|
||||
remarks: "",
|
||||
content: "",
|
||||
picUrl: "",
|
||||
appContent: ''
|
||||
price: '',
|
||||
unitName: '份',
|
||||
specificationUnit: '',
|
||||
weight: '',
|
||||
remarks: '',
|
||||
content: '',
|
||||
picUrl: '',
|
||||
brandId: null,
|
||||
brandName: '',
|
||||
categoryId: null,
|
||||
categoryName: ''
|
||||
},
|
||||
hideUploadBtn: false,
|
||||
brandList: [],
|
||||
cateList: [],
|
||||
hideUploadBtn: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
reqMall.listAllBrand().then(resp => {
|
||||
this.brandList = resp.data
|
||||
})
|
||||
reqMall.listAllCategory().then(resp => {
|
||||
this.cateList = resp.data
|
||||
})
|
||||
},
|
||||
backData(value) {
|
||||
console.log("backData》》》》", value)
|
||||
console.log("imgList", this.imgList)
|
||||
console.log('backData》》》》', value)
|
||||
console.log('imgList', this.imgList)
|
||||
|
||||
if (this.imgList.length > 0) {
|
||||
this.formobj.picUrl = this.imgList[0].url
|
||||
} else {
|
||||
this.formobj.picUrl = ""
|
||||
this.formobj.picUrl = ''
|
||||
}
|
||||
|
||||
this.hideUploadBtn = this.imgList.length != 0;
|
||||
console.log("this.hideUploadBtn", this.hideUploadBtn)
|
||||
this.hideUploadBtn = this.imgList.length != 0
|
||||
console.log('this.hideUploadBtn', this.hideUploadBtn)
|
||||
},
|
||||
|
||||
saveOrUpdate() {
|
||||
@@ -146,22 +207,21 @@
|
||||
if (isreload === 'true') this.$emit('reloadlist')
|
||||
this.imgList = []
|
||||
this.formobj = {
|
||||
sid: "",
|
||||
sid: '',
|
||||
name: '',
|
||||
code: '',
|
||||
barcode: '',
|
||||
price: "",
|
||||
unitName: "份",
|
||||
specificationUnit:"",
|
||||
weight:"",
|
||||
remarks: "",
|
||||
content: "",
|
||||
picUrl: "",
|
||||
price: '',
|
||||
unitName: '份',
|
||||
specificationUnit: '',
|
||||
weight: '',
|
||||
remarks: '',
|
||||
content: '',
|
||||
picUrl: '',
|
||||
appContent: ''
|
||||
}
|
||||
this.$emit('doback')
|
||||
},
|
||||
|
||||
showAdd() {
|
||||
console.log(this.imgList, 88888888)
|
||||
},
|
||||
@@ -171,30 +231,48 @@
|
||||
if (resp.success) {
|
||||
this.formobj = resp.data
|
||||
this.imgList = []
|
||||
if (resp.data.picUrl != '')
|
||||
this.imgList.push({
|
||||
if (resp.data.picUrl != '') {
|
||||
this.imgList.push({
|
||||
url: resp.data.picUrl
|
||||
})
|
||||
}
|
||||
|
||||
this.hideUploadBtn = this.imgList.length != 0;
|
||||
console.log("this.hideUploadBtn", this.hideUploadBtn)
|
||||
this.hideUploadBtn = this.imgList.length != 0
|
||||
console.log('this.hideUploadBtn', this.hideUploadBtn)
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
this.formobj = row
|
||||
this.imgList = []
|
||||
if (resp.data.picUrl != '')
|
||||
this.imgList.push({
|
||||
url: formobj.picUrl
|
||||
})
|
||||
// if (resp.data.picUrl != '') {
|
||||
// this.imgList.push({
|
||||
// url: formobj.picUrl
|
||||
// })
|
||||
// }
|
||||
|
||||
this.hideUploadBtn = this.imgList.length != 0;
|
||||
console.log("this.hideUploadBtn", this.hideUploadBtn)
|
||||
// this.hideUploadBtn = this.imgList.length != 0
|
||||
console.log('this.hideUploadBtn', this.hideUploadBtn)
|
||||
})
|
||||
},
|
||||
editinput(text) {
|
||||
this.formobj.appContent = text
|
||||
}
|
||||
},
|
||||
selectBrandChange(val) {
|
||||
for (var i = 0; i < this.brandList.length; i++) {
|
||||
if (val === this.brandList[i].id) {
|
||||
this.formobj.brandName = this.brandList[i].name
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
selectCateChange(val) {
|
||||
for (var i = 0; i < this.cateList.length; i++) {
|
||||
if (val === this.cateList[i].id) {
|
||||
this.formobj.categoryName = this.cateList[i].name
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -268,4 +346,4 @@
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -32,6 +32,12 @@
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始销售数量:">
|
||||
<el-input v-model="brand.qssl" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订购协议:">
|
||||
<el-input v-model="brand.dgxy" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('brandFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('brandFrom')">重置</el-button>
|
||||
@@ -55,7 +61,9 @@
|
||||
logo: '',
|
||||
name: '',
|
||||
showStatus: 0,
|
||||
sort: 0
|
||||
sort: 0,
|
||||
qssl: 0,
|
||||
dgxy: ''
|
||||
}
|
||||
export default {
|
||||
name: 'BrandDetail',
|
||||
|
||||
@@ -1,33 +1,34 @@
|
||||
<template>
|
||||
<div style="margin-top: 50px">
|
||||
<el-form :model="value" :rules="rules" ref="productInfoForm" label-width="120px" style="width: 600px" size="small">
|
||||
<el-form ref="productInfoForm" :model="value" :rules="rules" label-width="120px" style="width: 600px" size="small">
|
||||
<el-form-item label="商品分类:" prop="productCategoryId">
|
||||
<el-cascader
|
||||
change-on-select
|
||||
v-model="selectProductCateValue"
|
||||
:options="productCateOptions">
|
||||
</el-cascader>
|
||||
change-on-select
|
||||
:options="productCateOptions"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称:" prop="name">
|
||||
<el-input v-model="value.name"></el-input>
|
||||
<el-input v-model="value.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="副标题:" prop="subTitle">
|
||||
<el-input v-model="value.subTitle"></el-input>
|
||||
<el-input v-model="value.subTitle" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品品牌:" prop="brandId">
|
||||
<el-select
|
||||
v-model="value.brandId"
|
||||
placeholder="请选择品牌"
|
||||
@change="handleBrandChange"
|
||||
placeholder="请选择品牌">
|
||||
>
|
||||
<el-option
|
||||
v-for="item in brandOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="店内分类:" prop="storeClassId">
|
||||
<!-- <el-form-item label="店内分类:" prop="storeClassId">
|
||||
<el-select
|
||||
v-model="value.storeClassId"
|
||||
|
||||
@@ -46,7 +47,7 @@
|
||||
v-model="selectAreaValue"
|
||||
:options="areaOptions">
|
||||
</el-cascader>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="标签" prop="tags">
|
||||
<el-select
|
||||
v-model="value.tagList"
|
||||
@@ -64,45 +65,47 @@
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="商品介绍:">
|
||||
<el-input
|
||||
:autoSize="true"
|
||||
v-model="value.description"
|
||||
:auto-size="true"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"></el-input>
|
||||
placeholder="请输入内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品货号:">
|
||||
<el-input v-model="value.productSn"></el-input>
|
||||
<el-input v-model="value.productSn" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品售价:">
|
||||
<el-input v-model="value.price"></el-input>
|
||||
<el-input v-model="value.price" />
|
||||
</el-form-item>
|
||||
<el-form-item label="惠农价:">
|
||||
<el-input v-model="value.originalPrice"></el-input>
|
||||
<el-input v-model="value.originalPrice" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品库存:">
|
||||
<el-input v-model="value.stock"></el-input>
|
||||
<el-input v-model="value.stock" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计量单位:">
|
||||
<el-select
|
||||
v-model="value.unit"
|
||||
v-model="value.unit"
|
||||
|
||||
placeholder="请选择计量单位">
|
||||
placeholder="请选择计量单位"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.id"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.id"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="商品重量:">
|
||||
<el-input v-model="value.weight" style="width: 300px"></el-input>
|
||||
<el-input v-model="value.weight" style="width: 300px" />
|
||||
<span style="margin-left: 20px">千克</span>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="固定运费:">
|
||||
<!-- <el-form-item label="固定运费:">
|
||||
<el-input v-model="value.transfee" style="width: 300px"></el-input>
|
||||
<span style="margin-left: 20px">优先于运费模版</span>
|
||||
</el-form-item>
|
||||
@@ -120,7 +123,7 @@
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="排序">
|
||||
<el-input v-model="value.sort"></el-input>
|
||||
<el-input v-model="value.sort" />
|
||||
</el-form-item>
|
||||
<el-form-item style="text-align: center">
|
||||
<el-button type="primary" size="medium" @click="handleNext('productInfoForm')">下一步</el-button>
|
||||
@@ -130,17 +133,17 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {fetchListWithChildren} from '@/api/productCate'
|
||||
import {fetchAreaListWithChildren,getArea} from '@/api/area'
|
||||
import {fetchList as fetchTagList} from '@/api/ums/umsMemberTag'
|
||||
import {fetchList as fetchBrandList} from '@/api/brand'
|
||||
import {fetchList as fetchStoreClassList} from '@/api/sys/sysStoreClass'
|
||||
import { fetchListWithChildren } from '@/api/productCate'
|
||||
import { fetchAreaListWithChildren, getArea } from '@/api/area'
|
||||
import { fetchList as fetchTagList } from '@/api/ums/umsMemberTag'
|
||||
import { fetchList as fetchBrandList } from '@/api/brand'
|
||||
import { fetchList as fetchStoreClassList } from '@/api/sys/sysStoreClass'
|
||||
|
||||
import {fetchList as fetchFeightTemplateList} from '@/api/pms/feightTemplate';
|
||||
import {getProduct} from '@/api/product';
|
||||
import { fetchList as fetchFeightTemplateList } from '@/api/pms/feightTemplate'
|
||||
import { getProduct } from '@/api/product'
|
||||
let userRoles = []
|
||||
export default {
|
||||
name: "ProductInfoDetail",
|
||||
name: 'ProductInfoDetail',
|
||||
props: {
|
||||
value: Object,
|
||||
isEdit: {
|
||||
@@ -150,119 +153,116 @@ let userRoles = []
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
hasEditCreated:false,
|
||||
//选中商品分类的值
|
||||
hasEditCreated: false,
|
||||
// 选中商品分类的值
|
||||
selectProductCateValue: [],
|
||||
productCateOptions: [],
|
||||
//选中商品分类的值
|
||||
// 选中商品分类的值
|
||||
selectAreaValue: [],
|
||||
areaOptions: [],
|
||||
brandOptions: [],
|
||||
storeClassOptions:[],
|
||||
area:null,
|
||||
TagList:[],
|
||||
areaList:[],
|
||||
feightTemplateOptions:[],
|
||||
unitOptions:[{
|
||||
id: "个",
|
||||
name: "个",
|
||||
},{
|
||||
id: "袋",
|
||||
name: "袋",
|
||||
storeClassOptions: [],
|
||||
area: null,
|
||||
TagList: [],
|
||||
areaList: [],
|
||||
feightTemplateOptions: [],
|
||||
unitOptions: [{
|
||||
id: '个',
|
||||
name: '个'
|
||||
}, {
|
||||
id: '袋',
|
||||
name: '袋'
|
||||
},
|
||||
{
|
||||
id: "箱",
|
||||
name: "箱",
|
||||
id: '箱',
|
||||
name: '箱'
|
||||
},
|
||||
{
|
||||
id: "条",
|
||||
name: "条",
|
||||
id: '条',
|
||||
name: '条'
|
||||
},
|
||||
|
||||
{
|
||||
id: "盒",
|
||||
name: "盒",
|
||||
},{
|
||||
id: "包",
|
||||
name: "包",
|
||||
},{
|
||||
id: "斤",
|
||||
name: "斤",
|
||||
},{
|
||||
id: "两",
|
||||
name: "两",
|
||||
},{
|
||||
id: "件",
|
||||
name: "件",
|
||||
},{
|
||||
id: "瓶",
|
||||
name: "瓶",
|
||||
},{
|
||||
id: "千克",
|
||||
name: "千克",
|
||||
id: '盒',
|
||||
name: '盒'
|
||||
}, {
|
||||
id: '包',
|
||||
name: '包'
|
||||
}, {
|
||||
id: '斤',
|
||||
name: '斤'
|
||||
}, {
|
||||
id: '两',
|
||||
name: '两'
|
||||
}, {
|
||||
id: '件',
|
||||
name: '件'
|
||||
}, {
|
||||
id: '瓶',
|
||||
name: '瓶'
|
||||
}, {
|
||||
id: '千克',
|
||||
name: '千克'
|
||||
}],
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入商品名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
{ required: true, message: '请输入商品名称', trigger: 'blur' },
|
||||
{ min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur' }
|
||||
],
|
||||
subTitle: [{required: true, message: '请输入商品副标题', trigger: 'blur'}],
|
||||
productCategoryId: [{required: true, message: '请选择商品分类', trigger: 'blur'}],
|
||||
subTitle: [{ required: true, message: '请输入商品副标题', trigger: 'blur' }],
|
||||
productCategoryId: [{ required: true, message: '请选择商品分类', trigger: 'blur' }],
|
||||
|
||||
brandId: [{required: true, message: '请选择商品品牌', trigger: 'blur'}],
|
||||
description: [{required: true, message: '请输入商品介绍', trigger: 'blur'}],
|
||||
requiredProp: [{required: true, message: '该项为必填项', trigger: 'blur'}]
|
||||
brandId: [{ required: true, message: '请选择商品品牌', trigger: 'blur' }],
|
||||
description: [{ required: true, message: '请输入商品介绍', trigger: 'blur' }],
|
||||
requiredProp: [{ required: true, message: '该项为必填项', trigger: 'blur' }]
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getProductCateList();
|
||||
this.getAreaList();
|
||||
this.getBrandList();
|
||||
this.getTagList();
|
||||
this.getFeightTemplateList();
|
||||
this.getStoreClassList();
|
||||
|
||||
},
|
||||
computed:{
|
||||
//商品的编号
|
||||
productId(){
|
||||
return this.value.id;
|
||||
computed: {
|
||||
// 商品的编号
|
||||
productId() {
|
||||
return this.value.id
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
productId:function(newValue){
|
||||
if(!this.isEdit)return;
|
||||
if(this.hasEditCreated)return;
|
||||
productId: function(newValue) {
|
||||
if (!this.isEdit) return
|
||||
if (this.hasEditCreated) return
|
||||
console.log(newValue)
|
||||
if(newValue===undefined||newValue==null||newValue===0)return;
|
||||
this.handleEditCreated();
|
||||
if (newValue === undefined || newValue == null || newValue === 0) return
|
||||
this.handleEditCreated()
|
||||
},
|
||||
selectProductCateValue: function (newValue) {
|
||||
selectProductCateValue: function(newValue) {
|
||||
if (newValue != null) {
|
||||
this.value.productCategoryId = newValue[newValue.length-1 >0?newValue.length-1:0];
|
||||
this.value.productCategoryName= this.getCateNameById(this.value.productCategoryId);
|
||||
this.value.productCategoryId = newValue[newValue.length - 1 > 0 ? newValue.length - 1 : 0]
|
||||
this.value.productCategoryName = this.getCateNameById(this.value.productCategoryId)
|
||||
} else {
|
||||
this.value.productCategoryId = null;
|
||||
this.value.productCategoryName=null;
|
||||
this.value.productCategoryId = null
|
||||
this.value.productCategoryName = null
|
||||
}
|
||||
},
|
||||
selectAreaValue: function (newValue) {
|
||||
|
||||
selectAreaValue: function(newValue) {
|
||||
if (newValue != null) {
|
||||
console.log(newValue)
|
||||
this.value.areaId = newValue[newValue.length-1 >0?newValue.length-1:0];
|
||||
this.value.areaId = newValue[newValue.length - 1 > 0 ? newValue.length - 1 : 0]
|
||||
getArea(this.value.areaId).then(response => {
|
||||
this.value.areaName = response.data.name;
|
||||
});
|
||||
this.value.areaName = response.data.name
|
||||
})
|
||||
} else {
|
||||
this.value.areaId = null;
|
||||
this.value.areaName=null;
|
||||
this.value.areaId = null
|
||||
this.value.areaName = null
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.getProductCateList()
|
||||
// this.getAreaList()
|
||||
this.getBrandList()
|
||||
// this.getTagList()
|
||||
// this.getFeightTemplateList()
|
||||
// this.getStoreClassList()
|
||||
},
|
||||
methods: {
|
||||
changeRole(value) {
|
||||
userRoles = []
|
||||
@@ -286,25 +286,23 @@ let userRoles = []
|
||||
})
|
||||
this.value.tagList = initRoles
|
||||
},
|
||||
//处理编辑逻辑
|
||||
handleEditCreated(){
|
||||
|
||||
// 处理编辑逻辑
|
||||
handleEditCreated() {
|
||||
console.log(this.value)
|
||||
|
||||
if(this.value.productCategoryId!=null){
|
||||
let seleval = []
|
||||
seleval.push(this.value.cateParentId);
|
||||
seleval.push(this.value.productCategoryId);
|
||||
|
||||
if (this.value.productCategoryId != null) {
|
||||
const seleval = []
|
||||
seleval.push(this.value.cateParentId)
|
||||
seleval.push(this.value.productCategoryId)
|
||||
this.selectProductCateValue = seleval
|
||||
// this.selectProductCateValue.push(this.value.cateParentId);
|
||||
// this.selectProductCateValue.push(this.value.productCategoryId);
|
||||
}
|
||||
if(this.value.areaId!=null){
|
||||
if (this.value.areaId != null) {
|
||||
getArea(this.value.areaId).then(response => {
|
||||
this.selectAreaValue.push(response.data.pid);
|
||||
this.selectAreaValue.push(this.value.areaId);
|
||||
});
|
||||
|
||||
this.selectAreaValue.push(response.data.pid)
|
||||
this.selectAreaValue.push(this.value.areaId)
|
||||
})
|
||||
}
|
||||
console.log(this.selectAreaValue)
|
||||
userRoles = []
|
||||
@@ -317,114 +315,111 @@ let userRoles = []
|
||||
})
|
||||
console.log(this.value.tagList)
|
||||
this.value.tagList = roles
|
||||
this.hasEditCreated=true;
|
||||
this.hasEditCreated = true
|
||||
},
|
||||
|
||||
getAreaList() {
|
||||
|
||||
fetchAreaListWithChildren().then(response => {
|
||||
let list = response.data;
|
||||
this.areaList=list;
|
||||
this.areaOptions = [];
|
||||
const list = response.data
|
||||
this.areaList = list
|
||||
this.areaOptions = []
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let children = [];
|
||||
const children = []
|
||||
if (list[i].children != null && list[i].children.length > 0) {
|
||||
for (let j = 0; j < list[i].children.length; j++) {
|
||||
children.push({label: list[i].children[j].name, value: list[i].children[j].id});
|
||||
children.push({ label: list[i].children[j].name, value: list[i].children[j].id })
|
||||
}
|
||||
}
|
||||
this.areaOptions.push({label: list[i].name, value: list[i].id, children: children});
|
||||
this.areaOptions.push({ label: list[i].name, value: list[i].id, children: children })
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
getCateNameById(id){
|
||||
let name=null;
|
||||
for(let i=0;i<this.productCateOptions.length;i++){
|
||||
for(let j=0;j<this.productCateOptions[i].children.length;j++){
|
||||
if( this.productCateOptions[i].children[j].value && this.productCateOptions[i].children[j].value!=undefined && this.productCateOptions[i].children[j].value===id){
|
||||
name=this.productCateOptions[i].children[j].label;
|
||||
return name;
|
||||
getCateNameById(id) {
|
||||
let name = null
|
||||
for (let i = 0; i < this.productCateOptions.length; i++) {
|
||||
for (let j = 0; j < this.productCateOptions[i].children.length; j++) {
|
||||
if (this.productCateOptions[i].children[j].value && this.productCateOptions[i].children[j].value != undefined && this.productCateOptions[i].children[j].value === id) {
|
||||
name = this.productCateOptions[i].children[j].label
|
||||
return name
|
||||
}
|
||||
}
|
||||
}
|
||||
return name;
|
||||
return name
|
||||
},
|
||||
getProductCateList() {
|
||||
fetchListWithChildren().then(response => {
|
||||
let list = response.data;
|
||||
this.productCateOptions = [];
|
||||
const list = response.data
|
||||
this.productCateOptions = []
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let children = [];
|
||||
const children = []
|
||||
if (list[i].children != null && list[i].children.length > 0) {
|
||||
for (let j = 0; j < list[i].children.length; j++) {
|
||||
children.push({label: list[i].children[j].name, value: list[i].children[j].id});
|
||||
children.push({ label: list[i].children[j].name, value: list[i].children[j].id })
|
||||
}
|
||||
}
|
||||
this.productCateOptions.push({label: list[i].name, value: list[i].id, children: children});
|
||||
this.productCateOptions.push({ label: list[i].name, value: list[i].id, children: children })
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
getFeightTemplateList() {
|
||||
fetchFeightTemplateList({pageNum: 1, pageSize: 100}).then(response => {
|
||||
this.feightTemplateOptions = [];
|
||||
let feightTemplateList = response.data.records;
|
||||
fetchFeightTemplateList({ pageNum: 1, pageSize: 100 }).then(response => {
|
||||
this.feightTemplateOptions = []
|
||||
const feightTemplateList = response.data.records
|
||||
for (let i = 0; i < feightTemplateList.length; i++) {
|
||||
this.feightTemplateOptions.push({label: feightTemplateList[i].name, value: feightTemplateList[i].id});
|
||||
this.feightTemplateOptions.push({ label: feightTemplateList[i].name, value: feightTemplateList[i].id })
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
getBrandList() {
|
||||
fetchBrandList({pageNum: 1, pageSize: 100}).then(response => {
|
||||
this.brandOptions = [];
|
||||
let brandList = response.data.records;
|
||||
fetchBrandList({ pageNum: 1, pageSize: 100 }).then(response => {
|
||||
this.brandOptions = []
|
||||
const brandList = response.data.records
|
||||
for (let i = 0; i < brandList.length; i++) {
|
||||
this.brandOptions.push({label: brandList[i].name, value: brandList[i].id});
|
||||
this.brandOptions.push({ label: brandList[i].name, value: brandList[i].id })
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
getStoreClassList() {
|
||||
fetchStoreClassList({pageNum: 1, pageSize: 100}).then(response => {
|
||||
this.storeClassOptions = [];
|
||||
let brandList = response.data.records;
|
||||
fetchStoreClassList({ pageNum: 1, pageSize: 100 }).then(response => {
|
||||
this.storeClassOptions = []
|
||||
const brandList = response.data.records
|
||||
for (let i = 0; i < brandList.length; i++) {
|
||||
this.storeClassOptions.push({label: brandList[i].name, value: brandList[i].id});
|
||||
this.storeClassOptions.push({ label: brandList[i].name, value: brandList[i].id })
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
getTagList() {
|
||||
fetchTagList({pageNum: 1, pageSize: 100,type:2,status:1}).then(response => {
|
||||
this.TagList = response.data.records;
|
||||
});
|
||||
fetchTagList({ pageNum: 1, pageSize: 100, type: 2, status: 1 }).then(response => {
|
||||
this.TagList = response.data.records
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
handleNext(formName){
|
||||
handleNext(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$emit('nextStep');
|
||||
this.$emit('nextStep')
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
return false;
|
||||
duration: 1000
|
||||
})
|
||||
return false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
handleBrandChange(val) {
|
||||
let brandName = '';
|
||||
let brandName = ''
|
||||
for (let i = 0; i < this.brandOptions.length; i++) {
|
||||
if (this.brandOptions[i].value === val) {
|
||||
brandName = this.brandOptions[i].label;
|
||||
break;
|
||||
brandName = this.brandOptions[i].label
|
||||
break
|
||||
}
|
||||
}
|
||||
this.value.brandName = brandName;
|
||||
this.value.brandName = brandName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div style="margin-top: 50px">
|
||||
<el-form :model="value" ref="productSaleForm" label-width="120px" style="width: 600px" size="small">
|
||||
<!-- <el-form-item label="赠送积分:">
|
||||
<el-form ref="productSaleForm" :model="value" label-width="120px" style="width: 600px" size="small">
|
||||
<!-- <el-form-item label="赠送积分:">
|
||||
<el-input v-model="value.giftPoint"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="赠送成长值:">
|
||||
@@ -21,10 +21,10 @@
|
||||
<el-switch
|
||||
v-model="value.publishStatus"
|
||||
:active-value="1"
|
||||
:inactive-value="0">
|
||||
</el-switch>
|
||||
:inactive-value="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="分销商品:">
|
||||
<!-- <el-form-item label="分销商品:">
|
||||
<el-switch
|
||||
v-model="value.isFenxiao"
|
||||
:active-value="1"
|
||||
@@ -43,14 +43,14 @@
|
||||
<el-switch
|
||||
v-model="value.newStatus"
|
||||
:active-value="1"
|
||||
:inactive-value="0">
|
||||
</el-switch>
|
||||
:inactive-value="0"
|
||||
/>
|
||||
<span style="margin-left: 10px;margin-right: 10px">推荐</span>
|
||||
<el-switch
|
||||
v-model="value.recommandStatus"
|
||||
:active-value="1"
|
||||
:inactive-value="0">
|
||||
</el-switch>
|
||||
:inactive-value="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务保证:">
|
||||
<el-checkbox-group v-model="selectServiceList">
|
||||
@@ -60,18 +60,18 @@
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="详细页标题:">
|
||||
<el-input v-model="value.detailTitle"></el-input>
|
||||
<el-input v-model="value.detailTitle" />
|
||||
</el-form-item>
|
||||
<el-form-item label="详细页描述:">
|
||||
<el-input v-model="value.detailDesc"></el-input>
|
||||
<el-input v-model="value.detailDesc" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品关键字:">
|
||||
<el-input v-model="value.keywords"></el-input>
|
||||
<el-input v-model="value.keywords" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品备注:">
|
||||
<el-input v-model="value.note" type="textarea" :autoSize="true"></el-input>
|
||||
<el-input v-model="value.note" type="textarea" :auto-size="true" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="选择优惠方式:">
|
||||
<!-- <el-form-item label="选择优惠方式:">
|
||||
<el-radio-group v-model="value.promotionType" size="small">
|
||||
<el-radio-button :label="0">无优惠</el-radio-button>
|
||||
<el-radio-button :label="1">特惠促销</el-radio-button>
|
||||
@@ -88,8 +88,8 @@
|
||||
|
||||
type="datetime"
|
||||
:picker-options="pickerOptions1"
|
||||
placeholder="选择开始时间">
|
||||
</el-date-picker>
|
||||
placeholder="选择开始时间"
|
||||
/>
|
||||
</div>
|
||||
<div class="littleMargin">
|
||||
结束时间:
|
||||
@@ -98,43 +98,49 @@
|
||||
|
||||
type="datetime"
|
||||
:picker-options="pickerOptions1"
|
||||
placeholder="选择结束时间">
|
||||
</el-date-picker>
|
||||
placeholder="选择结束时间"
|
||||
/>
|
||||
</div>
|
||||
<div class="littleMargin">
|
||||
促销价格:
|
||||
<el-input style="width: 220px" v-model="value.promotionPrice" placeholder="输入促销价格"></el-input>
|
||||
<el-input v-model="value.promotionPrice" style="width: 220px" placeholder="输入促销价格" />
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item v-show="value.promotionType===2">
|
||||
<div v-for="(item, index) in value.memberPriceList" :class="{littleMargin:index!==0}">
|
||||
{{item.memberLevelName}}:
|
||||
<el-input v-model="item.memberPrice" style="width: 200px"></el-input>
|
||||
{{ item.memberLevelName }}:
|
||||
<el-input v-model="item.memberPrice" style="width: 200px" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="value.promotionType===3">
|
||||
<el-table :data="value.productLadderList"
|
||||
style="width: 80%" border>
|
||||
<el-table
|
||||
:data="value.productLadderList"
|
||||
style="width: 80%"
|
||||
border
|
||||
>
|
||||
<el-table-column
|
||||
label="数量"
|
||||
align="center"
|
||||
width="120">
|
||||
width="120"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.count"></el-input>
|
||||
<el-input v-model="scope.row.count" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="折扣"
|
||||
align="center"
|
||||
width="120">
|
||||
width="120"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.discount"></el-input>
|
||||
<el-input v-model="scope.row.discount" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作">
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="handleRemoveProductLadder(scope.$index, scope.row)">删除</el-button>
|
||||
<el-button type="text" @click="handleAddProductLadder(scope.$index, scope.row)">添加</el-button>
|
||||
@@ -143,27 +149,33 @@
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="value.promotionType===4">
|
||||
<el-table :data="value.productFullReductionList"
|
||||
style="width: 80%" border>
|
||||
<el-table
|
||||
:data="value.productFullReductionList"
|
||||
style="width: 80%"
|
||||
border
|
||||
>
|
||||
<el-table-column
|
||||
label="满"
|
||||
align="center"
|
||||
width="120">
|
||||
width="120"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.fullPrice"></el-input>
|
||||
<el-input v-model="scope.row.fullPrice" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="立减"
|
||||
align="center"
|
||||
width="120">
|
||||
width="120"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.reducePrice"></el-input>
|
||||
<el-input v-model="scope.row.reducePrice" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作">
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="handleRemoveFullReduction(scope.$index, scope.row)">删除</el-button>
|
||||
<el-button type="text" @click="handleAddFullReduction(scope.$index, scope.row)">添加</el-button>
|
||||
@@ -180,10 +192,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {fetchList as fetchMemberLevelList} from '@/api/memberLevel'
|
||||
import { fetchList as fetchMemberLevelList } from '@/api/memberLevel'
|
||||
|
||||
export default {
|
||||
name: "ProductSaleDetail",
|
||||
name: 'ProductSaleDetail',
|
||||
props: {
|
||||
value: Object,
|
||||
isEdit: {
|
||||
@@ -193,10 +205,38 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//日期选择器配置
|
||||
// 日期选择器配置
|
||||
pickerOptions1: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now();
|
||||
return time.getTime() < Date.now()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 选中的服务保证
|
||||
selectServiceList: {
|
||||
get() {
|
||||
const list = []
|
||||
if (this.value.serviceIds === undefined || this.value.serviceIds == null || this.value.serviceIds === '') return list
|
||||
const ids = this.value.serviceIds.split(',')
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
list.push(Number(ids[i]))
|
||||
}
|
||||
return list
|
||||
},
|
||||
set(newValue) {
|
||||
let serviceIds = ''
|
||||
if (newValue != null && newValue.length > 0) {
|
||||
for (let i = 0; i < newValue.length; i++) {
|
||||
serviceIds += newValue[i] + ','
|
||||
}
|
||||
if (serviceIds.endsWith(',')) {
|
||||
serviceIds = serviceIds.substr(0, serviceIds.length - 1)
|
||||
}
|
||||
this.value.serviceIds = serviceIds
|
||||
} else {
|
||||
this.value.serviceIds = null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,67 +245,39 @@
|
||||
if (this.isEdit) {
|
||||
// this.handleEditCreated();
|
||||
} else {
|
||||
fetchMemberLevelList({defaultStatus: 0}).then(response => {
|
||||
let memberPriceList = [];
|
||||
for (let i = 0; i < response.data.records.length; i++) {
|
||||
let item = response.data.records[i];
|
||||
memberPriceList.push({memberLevelId: item.id, memberLevelName: item.name})
|
||||
}
|
||||
this.value.memberPriceList = memberPriceList;
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
//选中的服务保证
|
||||
selectServiceList: {
|
||||
get() {
|
||||
let list = [];
|
||||
if (this.value.serviceIds === undefined || this.value.serviceIds == null || this.value.serviceIds === '') return list;
|
||||
let ids = this.value.serviceIds.split(',');
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
list.push(Number(ids[i]));
|
||||
}
|
||||
return list;
|
||||
},
|
||||
set(newValue) {
|
||||
let serviceIds = '';
|
||||
if (newValue != null && newValue.length > 0) {
|
||||
for (let i = 0; i < newValue.length; i++) {
|
||||
serviceIds += newValue[i] + ',';
|
||||
}
|
||||
if (serviceIds.endsWith(',')) {
|
||||
serviceIds = serviceIds.substr(0, serviceIds.length - 1)
|
||||
}
|
||||
this.value.serviceIds = serviceIds;
|
||||
} else {
|
||||
this.value.serviceIds = null;
|
||||
}
|
||||
}
|
||||
// fetchMemberLevelList({defaultStatus: 0}).then(response => {
|
||||
// let memberPriceList = [];
|
||||
// for (let i = 0; i < response.data.records.length; i++) {
|
||||
// let item = response.data.records[i];
|
||||
// memberPriceList.push({memberLevelId: item.id, memberLevelName: item.name})
|
||||
// }
|
||||
// this.value.memberPriceList = memberPriceList;
|
||||
// });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleEditCreated() {
|
||||
let ids = this.value.serviceIds.split(',');
|
||||
console.log('handleEditCreated', ids);
|
||||
const ids = this.value.serviceIds.split(',')
|
||||
console.log('handleEditCreated', ids)
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
this.selectServiceList.push(Number(ids[i]));
|
||||
this.selectServiceList.push(Number(ids[i]))
|
||||
}
|
||||
},
|
||||
handleRemoveProductLadder(index, row) {
|
||||
let productLadderList = this.value.productLadderList;
|
||||
const productLadderList = this.value.productLadderList
|
||||
if (productLadderList.length === 1) {
|
||||
productLadderList.pop();
|
||||
productLadderList.pop()
|
||||
productLadderList.push({
|
||||
count: 0,
|
||||
discount: 0,
|
||||
price: 0
|
||||
})
|
||||
} else {
|
||||
productLadderList.splice(index, 1);
|
||||
productLadderList.splice(index, 1)
|
||||
}
|
||||
},
|
||||
handleAddProductLadder(index, row) {
|
||||
let productLadderList = this.value.productLadderList;
|
||||
const productLadderList = this.value.productLadderList
|
||||
if (productLadderList.length < 3) {
|
||||
productLadderList.push({
|
||||
count: 0,
|
||||
@@ -276,33 +288,33 @@
|
||||
this.$message({
|
||||
message: '最多只能添加三条',
|
||||
type: 'warning'
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
handleRemoveFullReduction(index, row) {
|
||||
let fullReductionList = this.value.productFullReductionList;
|
||||
const fullReductionList = this.value.productFullReductionList
|
||||
if (fullReductionList.length === 1) {
|
||||
fullReductionList.pop();
|
||||
fullReductionList.pop()
|
||||
fullReductionList.push({
|
||||
fullPrice: 0,
|
||||
reducePrice: 0
|
||||
});
|
||||
})
|
||||
} else {
|
||||
fullReductionList.splice(index, 1);
|
||||
fullReductionList.splice(index, 1)
|
||||
}
|
||||
},
|
||||
handleAddFullReduction(index, row) {
|
||||
let fullReductionList = this.value.productFullReductionList;
|
||||
const fullReductionList = this.value.productFullReductionList
|
||||
if (fullReductionList.length < 3) {
|
||||
fullReductionList.push({
|
||||
fullPrice: 0,
|
||||
reducePrice: 0
|
||||
});
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
message: '最多只能添加三条',
|
||||
type: 'warning'
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
handlePrev() {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="main-content">
|
||||
<button-bar ref="btnbar" view-title="商品列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
<button-bar ref="btnbar" view-title="商品列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||
|
||||
<!-- <el-card class="filter-container" shadow="never">
|
||||
<!-- <el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
@@ -55,200 +54,200 @@
|
||||
</div>
|
||||
</el-card> -->
|
||||
|
||||
<div class="main-content" style="margin-left: 20px;margin-right: 20px;">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :model="listQuery" :inline="true" class="tab-header">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input v-model="listQuery.keyword" style="width: 203px" placeholder="商品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型:">
|
||||
<el-select v-model="listQuery.productAttributeCategoryId" placeholder="商品类型" clearable style="width: 160px;">
|
||||
<el-option
|
||||
v-for="item in productAttributeCategoryOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品分类:">
|
||||
<el-cascader
|
||||
v-model="selectProductCateValue"
|
||||
clearable
|
||||
change-on-select
|
||||
:options="productCateOptions"
|
||||
<div class="main-content" style="margin-left: 20px;margin-right: 20px;">
|
||||
<div class="searchcon">
|
||||
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||
{{ searchxianshitit }}
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :model="listQuery" :inline="true" class="tab-header">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input v-model="listQuery.keyword" style="width: 203px" placeholder="商品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型:">
|
||||
<el-select v-model="listQuery.productAttributeCategoryId" placeholder="商品类型" clearable style="width: 160px;">
|
||||
<el-option
|
||||
v-for="item in productAttributeCategoryOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品品牌:">
|
||||
<el-select v-model="listQuery.brandId" placeholder="请选择品牌" clearable>
|
||||
<el-option
|
||||
v-for="item in brandOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="上架状态:">
|
||||
<el-select v-model="listQuery.publishStatus" placeholder="全部" clearable style="width: 120px;">
|
||||
<el-option
|
||||
v-for="item in publishStatusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态:">
|
||||
<el-select v-model="listQuery.verifyStatus" placeholder="全部" clearable style="width: 120px;">
|
||||
<el-option
|
||||
v-for="item in verifyStatusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否新品:">
|
||||
<el-select v-model="listQuery.newStatus" placeholder="全部" clearable style="width: 120px;">
|
||||
<el-option
|
||||
v-for="item in newStatusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否推荐:">
|
||||
<el-select v-model="listQuery.recommandStatus" placeholder="全部" clearable style="width: 120px;">
|
||||
<el-option
|
||||
v-for="item in recommandStatusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleSearchList()">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="handleResetSearch()">重置</el-button>
|
||||
</div>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品分类:">
|
||||
<el-cascader
|
||||
v-model="selectProductCateValue"
|
||||
clearable
|
||||
change-on-select
|
||||
:options="productCateOptions"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品品牌:">
|
||||
<el-select v-model="listQuery.brandId" placeholder="请选择品牌" clearable>
|
||||
<el-option
|
||||
v-for="item in brandOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="上架状态:">
|
||||
<el-select v-model="listQuery.publishStatus" placeholder="全部" clearable style="width: 120px;">
|
||||
<el-option
|
||||
v-for="item in publishStatusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态:">
|
||||
<el-select v-model="listQuery.verifyStatus" placeholder="全部" clearable style="width: 120px;">
|
||||
<el-option
|
||||
v-for="item in verifyStatusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否新品:">
|
||||
<el-select v-model="listQuery.newStatus" placeholder="全部" clearable style="width: 120px;">
|
||||
<el-option
|
||||
v-for="item in newStatusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否推荐:">
|
||||
<el-select v-model="listQuery.recommandStatus" placeholder="全部" clearable style="width: 120px;">
|
||||
<el-option
|
||||
v-for="item in recommandStatusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btn" style="text-align: center;">
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleSearchList()">查询</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="handleResetSearch()">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 标签栏 -->
|
||||
<el-tabs v-model="status" type="card" style="margin-top: 10px;" @tab-click="handleGoods">
|
||||
<el-tab-pane name="0">
|
||||
<span slot="label"><i class="el-icon-s-order" /> 全部商品</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="1">
|
||||
<span slot="label"><i class="el-icon-bank-card" /> 出售中</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="2">
|
||||
<span slot="label"><i class="el-icon-refrigerator" /> 已售馨</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="3">
|
||||
<span slot="label"><i class="el-icon-truck" />仓库中</span>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane name="4">
|
||||
<!-- 标签栏 -->
|
||||
<el-tabs v-model="status" type="card" style="margin-top: 10px;" @tab-click="handleGoods">
|
||||
<el-tab-pane name="0">
|
||||
<span slot="label"><i class="el-icon-s-order" /> 全部商品</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="1">
|
||||
<span slot="label"><i class="el-icon-bank-card" /> 出售中</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="2">
|
||||
<span slot="label"><i class="el-icon-refrigerator" /> 已售馨</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="3">
|
||||
<span slot="label"><i class="el-icon-truck" />仓库中</span>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane name="4">
|
||||
<span slot="label"><i class="el-icon-truck"></i> 回收站</span>
|
||||
</el-tab-pane> -->
|
||||
<!-- <el-tab-pane name="5">
|
||||
<!-- <el-tab-pane name="5">
|
||||
<span slot="label"><i class="el-icon-truck"></i>
|
||||
<el-button class="btn-add" @click="handleAddProduct()" size="mini">
|
||||
添加商品
|
||||
</el-button>
|
||||
</span>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</el-tabs>
|
||||
|
||||
<div class="batch-operate-container">
|
||||
<el-select v-model="operateType" size="small" placeholder="批量操作">
|
||||
<el-option v-for="item in operates" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="search-button"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleBatchOperate()"
|
||||
>
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
<div class="table-container">
|
||||
<el-table
|
||||
ref="productTable"
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="60" align="center" />
|
||||
<el-table-column label="编号" width="100" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.id }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品图片" width="120" align="center">
|
||||
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.pic"></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.name }}</p>
|
||||
<p>品牌:{{ scope.row.brandName }}</p>
|
||||
<p>类别:{{ scope.row.productCategoryName }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="价格/货号" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>价格:¥{{ scope.row.price }}</p>
|
||||
<p>货号:{{ scope.row.productSn }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标签" width="140" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>上架:
|
||||
<el-switch
|
||||
v-model="scope.row.publishStatus"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="handlePublishStatusChange(scope.$index, scope.row)"
|
||||
/>
|
||||
</p>
|
||||
<p>新品:
|
||||
<el-switch
|
||||
v-model="scope.row.newStatus"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="handleNewStatusChange(scope.$index, scope.row)"
|
||||
/>
|
||||
</p>
|
||||
<p>推荐:
|
||||
<el-switch
|
||||
v-model="scope.row.recommandStatus"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="handleRecommendStatusChange(scope.$index, scope.row)"
|
||||
/>
|
||||
</p>
|
||||
<!-- <p>分销:
|
||||
<div class="batch-operate-container">
|
||||
<el-select v-model="operateType" size="small" placeholder="批量操作">
|
||||
<el-option v-for="item in operates" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="search-button"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleBatchOperate()"
|
||||
>
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
<div class="table-container">
|
||||
<el-table
|
||||
ref="productTable"
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="60" align="center" />
|
||||
<el-table-column label="编号" width="100" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.id }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品图片" width="120" align="center">
|
||||
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.pic"></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.name }}</p>
|
||||
<p>品牌:{{ scope.row.brandName }}</p>
|
||||
<p>类别:{{ scope.row.productCategoryName }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="价格/货号" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>价格:¥{{ scope.row.price }}</p>
|
||||
<p>货号:{{ scope.row.productSn }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标签" width="140" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>上架:
|
||||
<el-switch
|
||||
v-model="scope.row.publishStatus"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="handlePublishStatusChange(scope.$index, scope.row)"
|
||||
/>
|
||||
</p>
|
||||
<p>新品:
|
||||
<el-switch
|
||||
v-model="scope.row.newStatus"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="handleNewStatusChange(scope.$index, scope.row)"
|
||||
/>
|
||||
</p>
|
||||
<p>推荐:
|
||||
<el-switch
|
||||
v-model="scope.row.recommandStatus"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="handleRecommendStatusChange(scope.$index, scope.row)"
|
||||
/>
|
||||
</p>
|
||||
<!-- <p>分销:
|
||||
<el-switch @change="handleFenxiaoStatusChange(scope.$index, scope.row)"
|
||||
:active-value="1" :inactive-value="0" v-model="scope.row.isFenxiao">
|
||||
</el-switch>
|
||||
@@ -258,128 +257,127 @@
|
||||
:inactive-value="0" v-model="scope.row.isVip">
|
||||
</el-switch>
|
||||
</p> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="排序" width="100" align="center">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="排序" width="100" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sort}}</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="库存数" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.stock }}</p>
|
||||
<!-- <el-button type="primary" icon="el-icon-edit"
|
||||
<el-table-column label="库存数" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.stock }}</p>
|
||||
<!-- <el-button type="primary" icon="el-icon-edit"
|
||||
@click="handleShowSkuEditDialog(scope.$index, scope.row)" circle></el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销量" width="100" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.sale }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.verifyStatus | verifyStatusFilter }}</p>
|
||||
<p>
|
||||
<el-button type="text" @click="handleShowVeriyEditDialog(scope.$index, scope.row)">审核详情
|
||||
</el-button>
|
||||
</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>
|
||||
<el-button size="mini" @click="handleUpdateProduct(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<!-- <el-button size="mini" @click="handleDeleteStatus(scope.$index, scope.row)">回收
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销量" width="100" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.sale }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.verifyStatus | verifyStatusFilter }}</p>
|
||||
<p>
|
||||
<el-button type="text" @click="handleShowVeriyEditDialog(scope.$index, scope.row)">审核详情
|
||||
</el-button>
|
||||
</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="160" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>
|
||||
<el-button size="mini" @click="handleUpdateProduct(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<!-- <el-button size="mini" @click="handleDeleteStatus(scope.$index, scope.row)">回收
|
||||
</el-button>
|
||||
</p>
|
||||
<p>
|
||||
<el-button size="mini" @click="handleShowVeriyEditDialog(scope.$index, scope.row)">日志
|
||||
</el-button> -->
|
||||
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<el-dialog title="审核信息" :visible.sync="vertyProduct.dialogVisible" width="40%">
|
||||
<el-form ref="brandFrom" :model="vertyProduct" label-width="150px">
|
||||
<el-form-item label="审核状态:" prop="verifyStatus">
|
||||
<el-switch v-model="vertyProduct.verifyStatus" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审核备注:" prop="detail">
|
||||
<el-input v-model="vertyProduct.detail" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="vertyProduct.dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleEditVConfirm">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table style="width: 100%;margin-top: 20px" :data="vertyProduct.list" border>
|
||||
<el-table-column label="审核状态" width="160" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.status | verifyStatusFilter }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核人" width="160" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.vertifyMan }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核信息" width="160" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.detail }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核时间" width="160" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.createTime|formatTime }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="编辑货品信息" :visible.sync="editSkuInfo.dialogVisible" width="40%">
|
||||
<span>商品货号:</span>
|
||||
<span>{{ editSkuInfo.productSn }}</span>
|
||||
<el-input
|
||||
v-model="editSkuInfo.keyword"
|
||||
placeholder="按sku编号搜索"
|
||||
size="small"
|
||||
style="width: 50%;margin-left: 20px"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" @click="handleSearchEditSku" />
|
||||
</el-input>
|
||||
<el-table style="width: 100%;margin-top: 20px" :data="editSkuInfo.stockList" border>
|
||||
<el-table-column label="SKU编号" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.skuCode" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="(item,index) in editSkuInfo.productAttr"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ getProductSkuSp(scope.row,index) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销售价格" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.price" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品库存" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.stock" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存预警值" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.lowStock" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="editSkuInfo.dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleEditSkuConfirm">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<el-dialog title="审核信息" :visible.sync="vertyProduct.dialogVisible" width="40%">
|
||||
<el-form ref="brandFrom" :model="vertyProduct" label-width="150px">
|
||||
<el-form-item label="审核状态:" prop="verifyStatus">
|
||||
<el-switch v-model="vertyProduct.verifyStatus" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审核备注:" prop="detail">
|
||||
<el-input v-model="vertyProduct.detail" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="vertyProduct.dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleEditVConfirm">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table style="width: 100%;margin-top: 20px" :data="vertyProduct.list" border>
|
||||
<el-table-column label="审核状态" width="160" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.status | verifyStatusFilter }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核人" width="160" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.vertifyMan }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核信息" width="160" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.detail }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核时间" width="160" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.createTime|formatTime }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="编辑货品信息" :visible.sync="editSkuInfo.dialogVisible" width="40%">
|
||||
<span>商品货号:</span>
|
||||
<span>{{ editSkuInfo.productSn }}</span>
|
||||
<el-input
|
||||
v-model="editSkuInfo.keyword"
|
||||
placeholder="按sku编号搜索"
|
||||
size="small"
|
||||
style="width: 50%;margin-left: 20px"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" @click="handleSearchEditSku" />
|
||||
</el-input>
|
||||
<el-table style="width: 100%;margin-top: 20px" :data="editSkuInfo.stockList" border>
|
||||
<el-table-column label="SKU编号" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.skuCode" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="(item,index) in editSkuInfo.productAttr"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ getProductSkuSp(scope.row,index) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销售价格" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.price" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品库存" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.stock" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存预警值" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.lowStock" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="editSkuInfo.dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleEditSkuConfirm">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user