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

编辑回显

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