提交 057c871a 编写于 作者: chendeli's avatar chendeli

编辑回显

上级 afe3d191
......@@ -415,7 +415,7 @@
center>
<div class="stock-dia">
<div class="stock-item">更新库存后,将影响买家购买,请谨慎操作</div>
<div class="stock-item">当前库存:{{formData.stock}}</div>
<div class="stock-item">当前库存:{{formData.goodsStock}}</div>
<div class="demo-input-suffix">
{{stock.type == 1 ? '减少数量' : '增加数量'}}
<el-input v-model="stock.num" :placeholder="stock.placeholderTxt" style="width: 180px;"></el-input>
......@@ -679,8 +679,8 @@
const {goodsList} = res.data
this.formData = Object.assign(this.formData,{...goodsList[0]})
this.formData.optPrice = this.formData.costPrice/100;
this.fileGoodsList = this.getImges(goodsList[0].goodsImgList)
this.fileIntrList = this.getImges(goodsList[0].medicImgList)
this.fileGoodsList = this.getImges(goodsList[0].goodsImgList,1)
this.fileIntrList = this.getImges(goodsList[0].medicImgList,2)
this.isMedic = this.formData.goodsType == 5 ? true : false
if(this.isMedic){
this.getLever(5,2)
......@@ -691,16 +691,16 @@
})
},
getImges(d){
getImges(d,type){
let a = [];
if(d.length > 0){
for(let i=0;i<d.length;i++){
a.push({
url:d[i].goodsImgUrl,
imageUrl:d[i].goodsImgUrl,
url:type==1 ?d[i].goodsImgUrl :d[i].imageUrl,
imageUrl:type==1 ?d[i].goodsImgUrl :d[i].imageUrl,
id: d[i].id,
imageSort: d[i].imageSort,
imageType: d[i].id,imageType,
imageType: type == 1 ? d[i].imgType : d[i].imageType,
})
}
}
......@@ -826,14 +826,22 @@
complete() {
let formName = "formData";
let goodsImgList = this.fileGoodsList.map((item, index) => {
item.imageSort = index+1;
})
let specificationImgList = this.fileIntrList.map((item, index) => {
item.imageSort = index+1;
})
this.formData.goodsImages = goodsImgList;
this.formData.specificationImages = specificationImgList;
// let goodsImgList = this.fileGoodsList.map((item, index) => {
// item.imageSort = index+1;
// })
// console.log(this.fileGoodsList)
// let specificationImgList = this.fileIntrList.map((item, index) => {
// item.imageSort = index+1;
// })
for(let i=0;i<this.fileGoodsList.length;i++){
this.fileGoodsList[i].imageSort = i+1
}
for(let j=0;j<this.fileIntrList.length;j++){
this.fileIntrList[j].imageSort = j+1
}
this.formData.goodsImages = this.fileGoodsList;
this.formData.specificationImages = this.fileIntrList;
this.isgoodsImages = this.formData.goodsImages.length == 0 ? false :true;
this.isSpecification_url = this.formData.specificationImages.length == 0 ? false : true
this.formData.categoryId = this.formData.goodsType
......
......@@ -308,6 +308,7 @@
let req = {
base64Str : e.target.result.substr(e.target.result.indexOf("base64,") + 7),
storeId:self.searchForm.storeId
//import_type: 2,
};
//req.token = localStorage.getItem('storageToken');
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册