|
@ -1,33 +1,34 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div style="margin-top: 50px"> |
|
|
<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-form-item label="商品分类:" prop="productCategoryId"> |
|
|
<el-cascader |
|
|
<el-cascader |
|
|
change-on-select |
|
|
|
|
|
v-model="selectProductCateValue" |
|
|
v-model="selectProductCateValue" |
|
|
:options="productCateOptions"> |
|
|
change-on-select |
|
|
</el-cascader> |
|
|
:options="productCateOptions" |
|
|
|
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="商品名称:" prop="name"> |
|
|
<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> |
|
|
<el-form-item label="副标题:" prop="subTitle"> |
|
|
<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> |
|
|
<el-form-item label="商品品牌:" prop="brandId"> |
|
|
<el-form-item label="商品品牌:" prop="brandId"> |
|
|
<el-select |
|
|
<el-select |
|
|
v-model="value.brandId" |
|
|
v-model="value.brandId" |
|
|
|
|
|
placeholder="请选择品牌" |
|
|
@change="handleBrandChange" |
|
|
@change="handleBrandChange" |
|
|
placeholder="请选择品牌"> |
|
|
> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="item in brandOptions" |
|
|
v-for="item in brandOptions" |
|
|
:key="item.value" |
|
|
:key="item.value" |
|
|
:label="item.label" |
|
|
:label="item.label" |
|
|
:value="item.value"> |
|
|
:value="item.value" |
|
|
</el-option> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- <el-form-item label="店内分类:" prop="storeClassId"> |
|
|
<!-- <el-form-item label="店内分类:" prop="storeClassId"> |
|
|
<el-select |
|
|
<el-select |
|
|
v-model="value.storeClassId" |
|
|
v-model="value.storeClassId" |
|
|
|
|
|
|
|
@ -46,7 +47,7 @@ |
|
|
v-model="selectAreaValue" |
|
|
v-model="selectAreaValue" |
|
|
:options="areaOptions"> |
|
|
:options="areaOptions"> |
|
|
</el-cascader> |
|
|
</el-cascader> |
|
|
</el-form-item> --> |
|
|
</el-form-item> |
|
|
<el-form-item label="标签" prop="tags"> |
|
|
<el-form-item label="标签" prop="tags"> |
|
|
<el-select |
|
|
<el-select |
|
|
v-model="value.tagList" |
|
|
v-model="value.tagList" |
|
@ -64,45 +65,47 @@ |
|
|
:value="item.id" |
|
|
:value="item.id" |
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> --> |
|
|
<el-form-item label="商品介绍:"> |
|
|
<el-form-item label="商品介绍:"> |
|
|
<el-input |
|
|
<el-input |
|
|
:autoSize="true" |
|
|
|
|
|
v-model="value.description" |
|
|
v-model="value.description" |
|
|
|
|
|
:auto-size="true" |
|
|
type="textarea" |
|
|
type="textarea" |
|
|
placeholder="请输入内容"></el-input> |
|
|
placeholder="请输入内容" |
|
|
|
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="商品货号:"> |
|
|
<el-form-item label="商品货号:"> |
|
|
<el-input v-model="value.productSn"></el-input> |
|
|
<el-input v-model="value.productSn" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="商品售价:"> |
|
|
<el-form-item label="商品售价:"> |
|
|
<el-input v-model="value.price"></el-input> |
|
|
<el-input v-model="value.price" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="惠农价:"> |
|
|
<el-form-item label="惠农价:"> |
|
|
<el-input v-model="value.originalPrice"></el-input> |
|
|
<el-input v-model="value.originalPrice" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="商品库存:"> |
|
|
<el-form-item label="商品库存:"> |
|
|
<el-input v-model="value.stock"></el-input> |
|
|
<el-input v-model="value.stock" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="计量单位:"> |
|
|
<el-form-item label="计量单位:"> |
|
|
<el-select |
|
|
<el-select |
|
|
v-model="value.unit" |
|
|
v-model="value.unit" |
|
|
|
|
|
|
|
|
placeholder="请选择计量单位"> |
|
|
placeholder="请选择计量单位" |
|
|
|
|
|
> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="item in unitOptions" |
|
|
v-for="item in unitOptions" |
|
|
:key="item.id" |
|
|
:key="item.id" |
|
|
:label="item.id" |
|
|
:label="item.id" |
|
|
:value="item.id"> |
|
|
:value="item.id" |
|
|
</el-option> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="商品重量:"> |
|
|
<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> |
|
|
<span style="margin-left: 20px">千克</span> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- <el-form-item label="固定运费:"> |
|
|
<!-- <el-form-item label="固定运费:"> |
|
|
<el-input v-model="value.transfee" style="width: 300px"></el-input> |
|
|
<el-input v-model="value.transfee" style="width: 300px"></el-input> |
|
|
<span style="margin-left: 20px">优先于运费模版</span> |
|
|
<span style="margin-left: 20px">优先于运费模版</span> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -120,7 +123,7 @@ |
|
|
</el-form-item> --> |
|
|
</el-form-item> --> |
|
|
|
|
|
|
|
|
<el-form-item label="排序"> |
|
|
<el-form-item label="排序"> |
|
|
<el-input v-model="value.sort"></el-input> |
|
|
<el-input v-model="value.sort" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item style="text-align: center"> |
|
|
<el-form-item style="text-align: center"> |
|
|
<el-button type="primary" size="medium" @click="handleNext('productInfoForm')">下一步</el-button> |
|
|
<el-button type="primary" size="medium" @click="handleNext('productInfoForm')">下一步</el-button> |
|
@ -130,17 +133,17 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import {fetchListWithChildren} from '@/api/productCate' |
|
|
import { fetchListWithChildren } from '@/api/productCate' |
|
|
import {fetchAreaListWithChildren,getArea} from '@/api/area' |
|
|
import { fetchAreaListWithChildren, getArea } from '@/api/area' |
|
|
import {fetchList as fetchTagList} from '@/api/ums/umsMemberTag' |
|
|
import { fetchList as fetchTagList } from '@/api/ums/umsMemberTag' |
|
|
import {fetchList as fetchBrandList} from '@/api/brand' |
|
|
import { fetchList as fetchBrandList } from '@/api/brand' |
|
|
import {fetchList as fetchStoreClassList} from '@/api/sys/sysStoreClass' |
|
|
import { fetchList as fetchStoreClassList } from '@/api/sys/sysStoreClass' |
|
|
|
|
|
|
|
|
import {fetchList as fetchFeightTemplateList} from '@/api/pms/feightTemplate'; |
|
|
import { fetchList as fetchFeightTemplateList } from '@/api/pms/feightTemplate' |
|
|
import {getProduct} from '@/api/product'; |
|
|
import { getProduct } from '@/api/product' |
|
|
let userRoles = [] |
|
|
let userRoles = [] |
|
|
export default { |
|
|
export default { |
|
|
name: "ProductInfoDetail", |
|
|
name: 'ProductInfoDetail', |
|
|
props: { |
|
|
props: { |
|
|
value: Object, |
|
|
value: Object, |
|
|
isEdit: { |
|
|
isEdit: { |
|
@ -150,119 +153,116 @@ let userRoles = [] |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
hasEditCreated:false, |
|
|
hasEditCreated: false, |
|
|
//选中商品分类的值 |
|
|
// 选中商品分类的值 |
|
|
selectProductCateValue: [], |
|
|
selectProductCateValue: [], |
|
|
productCateOptions: [], |
|
|
productCateOptions: [], |
|
|
//选中商品分类的值 |
|
|
// 选中商品分类的值 |
|
|
selectAreaValue: [], |
|
|
selectAreaValue: [], |
|
|
areaOptions: [], |
|
|
areaOptions: [], |
|
|
brandOptions: [], |
|
|
brandOptions: [], |
|
|
storeClassOptions:[], |
|
|
storeClassOptions: [], |
|
|
area:null, |
|
|
area: null, |
|
|
TagList:[], |
|
|
TagList: [], |
|
|
areaList:[], |
|
|
areaList: [], |
|
|
feightTemplateOptions:[], |
|
|
feightTemplateOptions: [], |
|
|
unitOptions:[{ |
|
|
unitOptions: [{ |
|
|
id: "个", |
|
|
id: '个', |
|
|
name: "个", |
|
|
name: '个' |
|
|
},{ |
|
|
}, { |
|
|
id: "袋", |
|
|
id: '袋', |
|
|
name: "袋", |
|
|
name: '袋' |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: "箱", |
|
|
id: '箱', |
|
|
name: "箱", |
|
|
name: '箱' |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
id: "条", |
|
|
id: '条', |
|
|
name: "条", |
|
|
name: '条' |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
id: "盒", |
|
|
id: '盒', |
|
|
name: "盒", |
|
|
name: '盒' |
|
|
},{ |
|
|
}, { |
|
|
id: "包", |
|
|
id: '包', |
|
|
name: "包", |
|
|
name: '包' |
|
|
},{ |
|
|
}, { |
|
|
id: "斤", |
|
|
id: '斤', |
|
|
name: "斤", |
|
|
name: '斤' |
|
|
},{ |
|
|
}, { |
|
|
id: "两", |
|
|
id: '两', |
|
|
name: "两", |
|
|
name: '两' |
|
|
},{ |
|
|
}, { |
|
|
id: "件", |
|
|
id: '件', |
|
|
name: "件", |
|
|
name: '件' |
|
|
},{ |
|
|
}, { |
|
|
id: "瓶", |
|
|
id: '瓶', |
|
|
name: "瓶", |
|
|
name: '瓶' |
|
|
},{ |
|
|
}, { |
|
|
id: "千克", |
|
|
id: '千克', |
|
|
name: "千克", |
|
|
name: '千克' |
|
|
}], |
|
|
}], |
|
|
rules: { |
|
|
rules: { |
|
|
name: [ |
|
|
name: [ |
|
|
{required: true, message: '请输入商品名称', trigger: 'blur'}, |
|
|
{ required: true, message: '请输入商品名称', trigger: 'blur' }, |
|
|
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'} |
|
|
{ min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
subTitle: [{required: true, message: '请输入商品副标题', trigger: 'blur'}], |
|
|
subTitle: [{ required: true, message: '请输入商品副标题', trigger: 'blur' }], |
|
|
productCategoryId: [{required: true, message: '请选择商品分类', trigger: 'blur'}], |
|
|
productCategoryId: [{ required: true, message: '请选择商品分类', trigger: 'blur' }], |
|
|
|
|
|
|
|
|
brandId: [{required: true, message: '请选择商品品牌', trigger: 'blur'}], |
|
|
brandId: [{ required: true, message: '请选择商品品牌', trigger: 'blur' }], |
|
|
description: [{required: true, message: '请输入商品介绍', trigger: 'blur'}], |
|
|
description: [{ required: true, message: '请输入商品介绍', trigger: 'blur' }], |
|
|
requiredProp: [{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:{ |
|
|
computed: { |
|
|
//商品的编号 |
|
|
// 商品的编号 |
|
|
productId(){ |
|
|
productId() { |
|
|
return this.value.id; |
|
|
return this.value.id |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
productId:function(newValue){ |
|
|
productId: function(newValue) { |
|
|
if(!this.isEdit)return; |
|
|
if (!this.isEdit) return |
|
|
if(this.hasEditCreated)return; |
|
|
if (this.hasEditCreated) return |
|
|
console.log(newValue) |
|
|
console.log(newValue) |
|
|
if(newValue===undefined||newValue==null||newValue===0)return; |
|
|
if (newValue === undefined || newValue == null || newValue === 0) return |
|
|
this.handleEditCreated(); |
|
|
this.handleEditCreated() |
|
|
}, |
|
|
}, |
|
|
selectProductCateValue: function (newValue) { |
|
|
selectProductCateValue: function(newValue) { |
|
|
if (newValue != null) { |
|
|
if (newValue != null) { |
|
|
this.value.productCategoryId = newValue[newValue.length-1 >0?newValue.length-1:0]; |
|
|
this.value.productCategoryId = newValue[newValue.length - 1 > 0 ? newValue.length - 1 : 0] |
|
|
this.value.productCategoryName= this.getCateNameById(this.value.productCategoryId); |
|
|
this.value.productCategoryName = this.getCateNameById(this.value.productCategoryId) |
|
|
} else { |
|
|
} else { |
|
|
this.value.productCategoryId = null; |
|
|
this.value.productCategoryId = null |
|
|
this.value.productCategoryName=null; |
|
|
this.value.productCategoryName = null |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
selectAreaValue: function (newValue) { |
|
|
selectAreaValue: function(newValue) { |
|
|
|
|
|
|
|
|
if (newValue != null) { |
|
|
if (newValue != null) { |
|
|
console.log(newValue) |
|
|
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 => { |
|
|
getArea(this.value.areaId).then(response => { |
|
|
this.value.areaName = response.data.name; |
|
|
this.value.areaName = response.data.name |
|
|
}); |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
this.value.areaId = null; |
|
|
this.value.areaId = null |
|
|
this.value.areaName=null; |
|
|
this.value.areaName = null |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
created() { |
|
|
|
|
|
this.getProductCateList() |
|
|
|
|
|
// this.getAreaList() |
|
|
|
|
|
this.getBrandList() |
|
|
|
|
|
// this.getTagList() |
|
|
|
|
|
// this.getFeightTemplateList() |
|
|
|
|
|
// this.getStoreClassList() |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
changeRole(value) { |
|
|
changeRole(value) { |
|
|
userRoles = [] |
|
|
userRoles = [] |
|
@ -286,25 +286,23 @@ let userRoles = [] |
|
|
}) |
|
|
}) |
|
|
this.value.tagList = initRoles |
|
|
this.value.tagList = initRoles |
|
|
}, |
|
|
}, |
|
|
//处理编辑逻辑 |
|
|
// 处理编辑逻辑 |
|
|
handleEditCreated(){ |
|
|
handleEditCreated() { |
|
|
|
|
|
|
|
|
console.log(this.value) |
|
|
console.log(this.value) |
|
|
|
|
|
|
|
|
if(this.value.productCategoryId!=null){ |
|
|
if (this.value.productCategoryId != null) { |
|
|
let seleval = [] |
|
|
const seleval = [] |
|
|
seleval.push(this.value.cateParentId); |
|
|
seleval.push(this.value.cateParentId) |
|
|
seleval.push(this.value.productCategoryId); |
|
|
seleval.push(this.value.productCategoryId) |
|
|
this.selectProductCateValue = seleval |
|
|
this.selectProductCateValue = seleval |
|
|
// this.selectProductCateValue.push(this.value.cateParentId); |
|
|
// this.selectProductCateValue.push(this.value.cateParentId); |
|
|
// this.selectProductCateValue.push(this.value.productCategoryId); |
|
|
// this.selectProductCateValue.push(this.value.productCategoryId); |
|
|
} |
|
|
} |
|
|
if(this.value.areaId!=null){ |
|
|
if (this.value.areaId != null) { |
|
|
getArea(this.value.areaId).then(response => { |
|
|
getArea(this.value.areaId).then(response => { |
|
|
this.selectAreaValue.push(response.data.pid); |
|
|
this.selectAreaValue.push(response.data.pid) |
|
|
this.selectAreaValue.push(this.value.areaId); |
|
|
this.selectAreaValue.push(this.value.areaId) |
|
|
}); |
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
console.log(this.selectAreaValue) |
|
|
console.log(this.selectAreaValue) |
|
|
userRoles = [] |
|
|
userRoles = [] |
|
@ -317,114 +315,111 @@ let userRoles = [] |
|
|
}) |
|
|
}) |
|
|
console.log(this.value.tagList) |
|
|
console.log(this.value.tagList) |
|
|
this.value.tagList = roles |
|
|
this.value.tagList = roles |
|
|
this.hasEditCreated=true; |
|
|
this.hasEditCreated = true |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getAreaList() { |
|
|
getAreaList() { |
|
|
|
|
|
|
|
|
fetchAreaListWithChildren().then(response => { |
|
|
fetchAreaListWithChildren().then(response => { |
|
|
let list = response.data; |
|
|
const list = response.data |
|
|
this.areaList=list; |
|
|
this.areaList = list |
|
|
this.areaOptions = []; |
|
|
this.areaOptions = [] |
|
|
for (let i = 0; i < list.length; i++) { |
|
|
for (let i = 0; i < list.length; i++) { |
|
|
let children = []; |
|
|
const children = [] |
|
|
if (list[i].children != null && list[i].children.length > 0) { |
|
|
if (list[i].children != null && list[i].children.length > 0) { |
|
|
for (let j = 0; j < list[i].children.length; j++) { |
|
|
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){ |
|
|
getCateNameById(id) { |
|
|
let name=null; |
|
|
let name = null |
|
|
for(let i=0;i<this.productCateOptions.length;i++){ |
|
|
for (let i = 0; i < this.productCateOptions.length; i++) { |
|
|
for(let j=0;j<this.productCateOptions[i].children.length;j++){ |
|
|
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){ |
|
|
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; |
|
|
name = this.productCateOptions[i].children[j].label |
|
|
return name; |
|
|
return name |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return name; |
|
|
return name |
|
|
}, |
|
|
}, |
|
|
getProductCateList() { |
|
|
getProductCateList() { |
|
|
fetchListWithChildren().then(response => { |
|
|
fetchListWithChildren().then(response => { |
|
|
let list = response.data; |
|
|
const list = response.data |
|
|
this.productCateOptions = []; |
|
|
this.productCateOptions = [] |
|
|
for (let i = 0; i < list.length; i++) { |
|
|
for (let i = 0; i < list.length; i++) { |
|
|
let children = []; |
|
|
const children = [] |
|
|
if (list[i].children != null && list[i].children.length > 0) { |
|
|
if (list[i].children != null && list[i].children.length > 0) { |
|
|
for (let j = 0; j < list[i].children.length; j++) { |
|
|
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() { |
|
|
getFeightTemplateList() { |
|
|
fetchFeightTemplateList({pageNum: 1, pageSize: 100}).then(response => { |
|
|
fetchFeightTemplateList({ pageNum: 1, pageSize: 100 }).then(response => { |
|
|
this.feightTemplateOptions = []; |
|
|
this.feightTemplateOptions = [] |
|
|
let feightTemplateList = response.data.records; |
|
|
const feightTemplateList = response.data.records |
|
|
for (let i = 0; i < feightTemplateList.length; i++) { |
|
|
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() { |
|
|
getBrandList() { |
|
|
fetchBrandList({pageNum: 1, pageSize: 100}).then(response => { |
|
|
fetchBrandList({ pageNum: 1, pageSize: 100 }).then(response => { |
|
|
this.brandOptions = []; |
|
|
this.brandOptions = [] |
|
|
let brandList = response.data.records; |
|
|
const brandList = response.data.records |
|
|
for (let i = 0; i < brandList.length; i++) { |
|
|
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() { |
|
|
getStoreClassList() { |
|
|
fetchStoreClassList({pageNum: 1, pageSize: 100}).then(response => { |
|
|
fetchStoreClassList({ pageNum: 1, pageSize: 100 }).then(response => { |
|
|
this.storeClassOptions = []; |
|
|
this.storeClassOptions = [] |
|
|
let brandList = response.data.records; |
|
|
const brandList = response.data.records |
|
|
for (let i = 0; i < brandList.length; i++) { |
|
|
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() { |
|
|
getTagList() { |
|
|
fetchTagList({pageNum: 1, pageSize: 100,type:2,status:1}).then(response => { |
|
|
fetchTagList({ pageNum: 1, pageSize: 100, type: 2, status: 1 }).then(response => { |
|
|
this.TagList = response.data.records; |
|
|
this.TagList = response.data.records |
|
|
}); |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handleNext(formName) { |
|
|
handleNext(formName){ |
|
|
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
this.$refs[formName].validate((valid) => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
this.$emit('nextStep'); |
|
|
this.$emit('nextStep') |
|
|
} else { |
|
|
} else { |
|
|
this.$message({ |
|
|
this.$message({ |
|
|
message: '验证失败', |
|
|
message: '验证失败', |
|
|
type: 'error', |
|
|
type: 'error', |
|
|
duration:1000 |
|
|
duration: 1000 |
|
|
}); |
|
|
}) |
|
|
return false; |
|
|
return false |
|
|
} |
|
|
} |
|
|
}); |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleBrandChange(val) { |
|
|
handleBrandChange(val) { |
|
|
let brandName = ''; |
|
|
let brandName = '' |
|
|
for (let i = 0; i < this.brandOptions.length; i++) { |
|
|
for (let i = 0; i < this.brandOptions.length; i++) { |
|
|
if (this.brandOptions[i].value === val) { |
|
|
if (this.brandOptions[i].value === val) { |
|
|
brandName = this.brandOptions[i].label; |
|
|
brandName = this.brandOptions[i].label |
|
|
break; |
|
|
break |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.value.brandName = brandName; |
|
|
this.value.brandName = brandName |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|