Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
b8634220
提交
b8634220
编写于
8月 24, 2020
作者:
yi.li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新建编辑商品
上级
cf602577
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
22 行增加
和
9 行删除
+22
-9
create-good.vue
src/views/goods/create-good.vue
+22
-9
未找到文件。
src/views/goods/create-good.vue
浏览文件 @
b8634220
...
@@ -635,7 +635,7 @@
...
@@ -635,7 +635,7 @@
const {id, storeId} = this.$route.query
const {id, storeId} = this.$route.query
this.title = id == 'add' ? '新增商品' : '编辑商品'
this.title = id == 'add' ? '新增商品' : '编辑商品'
this.formData.storeId =
storeId
|| 0;
this.formData.storeId =
Number(storeId)
|| 0;
this.getLever(0,1)
this.getLever(0,1)
dosageAll().then((res)=>{
dosageAll().then((res)=>{
this.doseAll = res.data
this.doseAll = res.data
...
@@ -695,7 +695,13 @@
...
@@ -695,7 +695,13 @@
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({url:d[i].goodsImgUrl,imageUrl:d[i].goodsImgUrl})
a.push({
url:d[i].goodsImgUrl,
imageUrl:d[i].goodsImgUrl,
id: d[i].id,
imageSort: d[i].imageSort,
imageType: d[i].id,imageType,
})
}
}
}
}
return a;
return a;
...
@@ -820,8 +826,14 @@
...
@@ -820,8 +826,14 @@
complete() {
complete() {
let formName = "
formData
";
let formName = "
formData
";
this.formData.goodsImages = this.fileGoodsList
let goodsImgList = this.fileGoodsList.map((item, index) => {
this.formData.specificationImages = this.fileIntrList
item.imageSort = index+1;
})
let specificationImgList = this.fileIntrList.map((item, index) => {
item.imageSort = index+1;
})
this.formData.goodsImages = goodsImgList;
this.formData.specificationImages = specificationImgList;
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
...
@@ -853,6 +865,7 @@
...
@@ -853,6 +865,7 @@
//this.formData.incrStock = 1000
//this.formData.incrStock = 1000
this.formData.costPrice = this.formData.optPrice*100
this.formData.costPrice = this.formData.optPrice*100
this.formData.hasChanged = true;
this.formData.hasChanged = true;
console.log('提交值',this.formData);
updateGoods(this.formData).then((res)=>{
updateGoods(this.formData).then((res)=>{
if (res.code !== '000000') {
if (res.code !== '000000') {
// return this.$message.error(res.message);
// return this.$message.error(res.message);
...
@@ -870,7 +883,7 @@
...
@@ -870,7 +883,7 @@
})
})
})
})
},
},
//上传商品头图
beforeUploadPic(file) {
beforeUploadPic(file) {
if(this.fileGoodsList.length > 10){
if(this.fileGoodsList.length > 10){
return ;
return ;
...
@@ -909,7 +922,7 @@
...
@@ -909,7 +922,7 @@
// vm.uploadImgMessage2 = false;
// vm.uploadImgMessage2 = false;
// }
// }
let len = vm.fileGoodsList.length;
let len = vm.fileGoodsList.length;
vm.fileGoodsList.push({url:path.fullPath,imageUrl:path.fullPath,imageName:'',imageSort: len+1})
vm.fileGoodsList.push({url:path.fullPath,imageUrl:path.fullPath,imageName:'',imageSort: len+1
,imageType: 2,id: null,
})
//vm.formData.goodsImages = path.fullPath
//vm.formData.goodsImages = path.fullPath
vm.$message.success("
上传成功
");
vm.$message.success("
上传成功
");
});
});
...
@@ -931,7 +944,7 @@
...
@@ -931,7 +944,7 @@
},
},
//上传
店铺logo
//上传
药品说明
beforeUploadPic1(file,type) {
beforeUploadPic1(file,type) {
this.currentOption.aspectRatio = 1/1;
this.currentOption.aspectRatio = 1/1;
this.currentOption.cropBoxResizable = true;
this.currentOption.cropBoxResizable = true;
...
@@ -983,8 +996,8 @@
...
@@ -983,8 +996,8 @@
openLoading(vm);
openLoading(vm);
doUpload(vm, file, getFilePath(file, null), "
preview4
", "
progress1
", 1).then(function (path) {
doUpload(vm, file, getFilePath(file, null), "
preview4
", "
progress1
", 1).then(function (path) {
closeLoading(vm);
closeLoading(vm);
let len = vm.fileIntrList.length;
vm.fileIntrList.push({url:path.fullPath,imageUrl:path.fullPath})
vm.fileIntrList.push({url:path.fullPath,imageUrl:path.fullPath
,imageSort: len+1,imageType: 1,id: null
})
vm.$message.success("
上传成功
");
vm.$message.success("
上传成功
");
});
});
//}
//}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录