Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
S
shop-new
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
王天霸
shop-new
Commits
4c8c8b61
提交
4c8c8b61
authored
7月 28, 2021
作者:
王天霸
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev_hxz' into test
上级
d4c8d191
d7bb2b7b
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
165 行增加
和
29 行删除
+165
-29
goods.js
src/api/module/goods.js
+18
-0
goodsaftersale.vue
src/views/system/goods/add/components/goodsaftersale.vue
+2
-0
goodsimg.vue
src/views/system/goods/add/components/goodsimg.vue
+3
-0
goodsinfomation.vue
src/views/system/goods/add/components/goodsinfomation.vue
+15
-11
goodsspecifications.vue
...views/system/goods/add/components/goodsspecifications.vue
+5
-1
index.vue
src/views/system/goods/add/index.vue
+115
-11
goodsgement.vue
src/views/system/goodsimport/goodsgement.vue
+7
-6
没有找到文件。
src/api/module/goods.js
浏览文件 @
4c8c8b61
...
...
@@ -75,6 +75,24 @@ export function addGoods(data) {
})
}
// 查询商品详情
export
function
getGoodsNew
(
data
)
{
return
request
({
url
:
'/system/goodsNew/info'
,
method
:
'post'
,
data
:
data
})
}
// 商品编辑 new
export
function
updateGoodsNew
(
data
)
{
return
request
({
url
:
'/system/goodsNew/goodsEdit'
,
method
:
'post'
,
data
:
data
})
}
// 修改goods
export
function
updateGoods
(
data
)
{
return
request
({
...
...
src/views/system/goods/add/components/goodsaftersale.vue
浏览文件 @
4c8c8b61
...
...
@@ -79,6 +79,8 @@
},
mounted
()
{
this
.
getFreightData
();
console
.
log
(
'售后数据:'
,
this
.
goodsaftersale
);
this
.
goodsAfterSaleForm
=
this
.
goodsaftersale
;
},
methods
:
{
// 运费模板
...
...
src/views/system/goods/add/components/goodsimg.vue
浏览文件 @
4c8c8b61
...
...
@@ -76,6 +76,9 @@
},
components
:
{},
mounted
()
{
this
.
goodsDeForm
=
this
.
imgdata
;
console
.
log
(
"详情:"
,
this
.
imgdata
);
},
watch
:
{},
methods
:
{
...
...
src/views/system/goods/add/components/goodsinfomation.vue
浏览文件 @
4c8c8b61
...
...
@@ -139,6 +139,7 @@
areaOptions
:
[],
// 地址 省
brandOptions
:
[],
// 商品品牌
goodsInfoForm
:
{
goods_id
:
0
,
categoryStr
:
''
,
// 商品分类 地址拼接
categoryList
:
[],
// 商品分类 id集合的数组
goods_des
:
''
,
// 关键词
...
...
@@ -210,22 +211,25 @@
// },
},
created
()
{
},
mounted
()
{
//深拷贝一份最开始的数据,为初始化准备
this
.
goodsInfoDataClone
=
this
.
deepClone
(
this
.
goodsinfodata
);
this
.
goodsInfoForm
.
categoryStr
=
this
.
goodsinfodata
.
categoryStr
;
this
.
goodsInfoForm
.
categoryList
=
this
.
goodsinfodata
.
categoryList
;
// console.log("父组件传过来的",this.goodsinfodata)
// console.log("1111",this.goodsInfoForm)
//this.goodsInfoDataClone = this.deepClone(this.goodsinfodata);
this
.
goodsInfoForm
=
this
.
goodsinfodata
;
if
(
this
.
goodsInfoForm
.
imgs
.
length
>
0
)
{
this
.
goodsInfoForm
.
imgs
.
forEach
(
(
item
)
=>
{
let
objImg
=
{
'url'
:
''
}
objImg
.
url
=
item
;
this
.
goodsImgFileList
.
push
(
objImg
);
})
}
//console.log("tup",this.goodsImgFileList)
// 获取 省
this
.
getArea
();
// 获取 商品品牌
this
.
getBrands
();
},
mounted
()
{
// this.getCategory();
// this.getFreight();
// this.getBrands();
},
methods
:
{
// 获取 省
...
...
src/views/system/goods/add/components/goodsspecifications.vue
浏览文件 @
4c8c8b61
...
...
@@ -113,11 +113,15 @@ export default {
this
.
$set
(
this
.
specsGroup
.
spec_value
,
this
.
specsGroup
.
spec_value
.
length
,
this
.
speParamName
);
this
.
speData
=
[];
this
.
$set
(
this
.
speData
,
this
.
speData
.
length
,
this
.
specsGroup
);
//console.log(71,this.specsGroup.spec_value);
},
mounted
()
{
/** 先获取 本地存储的localStorage **/
this
.
getLocalSpecNameOption
();
// this.speData = [];
// this.$set(this.speData,this.speData.length,this.specsGroup);
// console.log(123,this.specificationsdata)
this
.
speData
=
this
.
specificationsdata
;
this
.
$forceUpdate
()
},
watch
:{
// "speData.specsGroup": {
...
...
src/views/system/goods/add/index.vue
浏览文件 @
4c8c8b61
<
template
>
<div
class=
"
app-container
"
>
<div
class=
"
goods-all
"
>
<!-- 选择商品类目 start -->
<el-card
class=
"
box-card
"
v-if=
"!isShowGoodsDetails"
>
<el-card
class=
"
good-all-type
"
v-if=
"!isShowGoodsDetails"
>
<div
slot=
"header"
class=
"clearfix"
>
<p
class=
"card-header-title"
><span
class=
"blue-block-goods"
></span>
确认商品所在目录
</p>
</div>
...
...
@@ -77,7 +77,7 @@
<
script
>
import
{
getAreaList
}
from
'@/api/module/retreat/address'
;
import
{
NewGetCategory
,
addGoods
}
from
'@/api/module/goods'
;
import
{
NewGetCategory
,
addGoods
,
getGoodsNew
,
updateGoodsNew
}
from
'@/api/module/goods'
;
import
Goodsinfomation
from
'./components/goodsinfomation'
;
import
GoodsSpecifications
from
'./components/goodsspecifications'
;
import
GoodsParameter
from
'./components/goodsparameter'
;
...
...
@@ -93,6 +93,12 @@
Goodsimg
,
Goodsaftersale
,
},
props
:
{
option
:
{
type
:
Number
,
required
:
true
}
},
data
()
{
return
{
loading
:
false
,
...
...
@@ -119,19 +125,26 @@
],
/* 商品信息 */
goodsinfodata
:
{
orgGoodsInfoForm
:
{},
//
orgGoodsInfoForm: {},
categoryList
:
[],
categoryStr
:
''
},
/* 商品规格 */
specificationsdata
:
[],
/* 商品售价 */
parameterdata
:
{},
parameterdata
:
{
},
/* 商品详情 */
imgdata
:
{},
imgdata
:
{
description
:
''
},
/* 售后及服务 */
goodsaftersale
:
{
stags
:
[],
freight_id
:
310
,
delay_compensate
:
24
,
aftersale_time
:
7
},
goodsAllData
:
{
submit
:
0
,
...
...
@@ -141,7 +154,68 @@
},
created
()
{
// option 商品的id
if
(
this
.
option
&&
this
.
option
!==
0
)
{
let
data
=
{
goodsId
:
this
.
option
};
getGoodsNew
(
data
).
then
(
res
=>
{
console
.
log
(
"编辑接口返回"
,
res
);
if
(
res
.
data
)
{
this
.
isShowGoodsDetails
=
true
;
// 商品信息
this
.
goodsinfodata
=
{
goods_id
:
res
.
data
.
goods_id
,
categoryStr
:
''
,
// 商品分类 地址拼接
categoryList
:
[],
// 商品分类 id集合的数组
goods_des
:
res
.
data
.
goods_des
,
// 关键词
goods_name
:
res
.
data
.
goods_name
,
// 商品标题
category_id
:
res
.
data
.
category_id
,
producing_area
:
res
.
data
.
producing_area
,
// 产地
deliver_area
:
res
.
data
.
deliver_area
,
// 发货地
unit
:
res
.
data
.
unit
,
// 单位
goods_brand
:
res
.
data
.
goods_brand
,
// 品牌
web_url
:
res
.
data
.
web_url
,
// 外部链接
out_goods_id
:
res
.
data
.
out_goods_id
,
// 商品编码
imgs
:
res
.
data
.
imgs
// 商品图片
}
this
.
goodsinfodata
.
categoryStr
=
res
.
data
.
category_first_name
+
'/'
+
res
.
data
.
category_first_name
+
'/'
+
res
.
data
.
category_three_name
;
let
arr
=
[];
arr
[
0
]
=
res
.
data
.
category_first_id
;
arr
[
0
]
=
res
.
data
.
category_second_id
;
arr
[
0
]
=
res
.
data
.
category_three_id
;
this
.
goodsinfodata
.
categoryList
=
arr
;
// 商品规格, 售价由规格决定
if
(
res
.
data
.
specs
&&
res
.
data
.
specs
.
length
>
0
)
{
this
.
specificationsdata
=
res
.
data
.
specs
;
}
// 商品详情
this
.
imgdata
.
description
=
res
.
data
.
description
;
//this.goodsinfodata = res.data;
//this.imgdata = res.data.description;
//this.goodsaftersale = res.data;
// 售后服务
// stags: [],
// freight_id: 310,
// delay_compensate: 24,
// aftersale_time: 7
this
.
goodsaftersale
.
freight_id
=
res
.
data
.
freight_id
;
this
.
goodsaftersale
.
delay_compensate
=
res
.
data
.
delay_compensate
;
this
.
goodsaftersale
.
aftersale_time
=
res
.
data
.
aftersale_time
;
let
stagArr
=
[];
if
(
res
.
data
.
stags
.
indexOf
(
','
)
>
-
1
)
{
stagArr
=
res
.
data
.
stags
.
split
(
','
);
stagArr
.
forEach
(
item
=>
{
if
(
item
)
{
this
.
goodsaftersale
.
stags
.
push
(
Number
(
item
));
}
})
}
}
});
}
},
mounted
()
{
...
...
@@ -257,7 +331,6 @@
},
// 添加商品后,下一步 操作
nextStep
()
{
// debugger
// 注意数据格式 [1,2,3] 数组,且里面是数字类型
let
ssqLabelList
=
this
.
$refs
[
'ssqCascader'
].
getCheckedNodes
()[
0
].
pathLabels
;
this
.
goodsinfodata
.
categoryList
=
this
.
SSQList
;
...
...
@@ -273,6 +346,14 @@
// },
//
save
()
{
// let spxxDataId = this.$refs.goodsInfo.goodsInfoForm.goods_id;
//
// if(!spxxDataId) {
//
// }
// 此处变量 有顺序 校验时,电梯至某处
// 商品信息 是否填写完整
let
isGoodsInfoMsg
=
this
.
$refs
[
'goodsInfo'
].
validateGoodsInfoForm
();
...
...
@@ -395,9 +476,17 @@
console
.
log
(
'最终数据:'
,
this
.
goodsAllData
);
addGoods
(
this
.
goodsAllData
).
then
(
res
=>
{
console
.
log
(
"返回结果"
,
res
);
});
if
(
this
.
goodsAllData
.
goods_id
)
{
updateGoodsNew
(
this
.
goodsAllData
).
then
(
res
=>
{
console
.
log
(
"修改结果:"
,
res
);
});
}
else
{
addGoods
(
this
.
goodsAllData
).
then
(
res
=>
{
console
.
log
(
"返回结果"
,
res
);
});
}
},
...
...
@@ -485,6 +574,21 @@
</
script
>
<
style
scoped
lang=
"scss"
type=
"text/css"
>
.goods-all
{
height
:
100%
;
padding
:
20px
;
}
/
deep
/
.goods-all
.good-all-type
{
height
:
100%
;
}
/
deep
/
.goods-all
.el-card
.el-card__body
{
height
:
100%
;
overflow
:
auto
;
}
p
{
margin
:
0
;
padding
:
0
;
...
...
src/views/system/goodsimport/goodsgement.vue
浏览文件 @
4c8c8b61
...
...
@@ -113,7 +113,7 @@
</
template
>
</el-table-column>
<el-table-column
label=
"商品编号"
align=
"center"
prop=
"goods_id"
/>
<el-table-column
label=
"商品名称"
align=
"center"
prop=
"goods_
brand
"
/>
<el-table-column
label=
"商品名称"
align=
"center"
prop=
"goods_
name
"
/>
<el-table-column
label=
"协议价"
align=
"center"
prop=
""
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
js_price
/
100
}}
元
...
...
@@ -217,7 +217,7 @@
/>
<!-- 商品编辑-->
<el-dialog
title=
"编辑商品"
:visible
.
sync=
"editisOpen"
v-if=
"editisOpen"
width=
"70%"
class=
"freightTemplate-add"
>
<editGood
:option=
"
form
"
@
closeIndexbtn=
"closeDialog"
></editGood>
<editGood
:option=
"
goodsid
"
@
closeIndexbtn=
"closeDialog"
></editGood>
</el-dialog>
<el-dialog
title=
"商品详情"
:visible
.
sync=
"isOpen"
center
v-if=
"isOpen"
width=
"70%"
class=
"freightTemplate-add"
:close-on-click-modal=
"false"
>
<goodDetail
:goods-id=
"goodDetails"
@
closeIndexbtn=
"closeDialog"
></goodDetail>
...
...
@@ -289,7 +289,7 @@
modified
:
null
,
},
// 表单参数
form
:
{}
,
goodsid
:
0
,
// 表单校验
rules
:
{
name
:
[
...
...
@@ -408,7 +408,7 @@
delgoodsStatus
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
){
done
()
this
.
$message
({
type
:
'success'
,
message
:
'操作成功!'
...
...
@@ -421,7 +421,7 @@
message
:
res
.
message
});
}
})
}
else
{
done
();
...
...
@@ -493,8 +493,9 @@
});
},
editgoods
(){
//商品编辑
editgoods
(
row
){
//商品编辑
this
.
editisOpen
=
true
this
.
goodsid
=
Number
(
row
.
goods_id
);
},
lookdetail
(
row
){
//预览商品详情
this
.
isOpen
=
true
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论