Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
S
shop-new
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
王天霸
shop-new
Commits
77569b97
提交
77569b97
authored
8月 03, 2021
作者:
huaxinzhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商品 bug修复,其他优化,编辑器,不能粘贴图片,
上级
a60e00d9
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
67 行增加
和
11 行删除
+67
-11
goodsimg.vue
src/views/system/goods/add/components/goodsimg.vue
+20
-1
goodsparameter.vue
src/views/system/goods/add/components/goodsparameter.vue
+0
-1
goodsgement.vue
src/views/system/goodsimport/goodsgement.vue
+5
-2
index.vue
src/views/system/goodsimport/index.vue
+42
-7
没有找到文件。
src/views/system/goods/add/components/goodsimg.vue
浏览文件 @
77569b97
...
...
@@ -67,6 +67,10 @@
}
}
}
},
// 禁止粘贴图片
clipboard
:
{
matchers
:
[[
Node
.
ELEMENT_NODE
,
this
.
handleCustomMatcher
]]
}
}
},
...
...
@@ -81,6 +85,21 @@
},
watch
:
{},
methods
:
{
handleCustomMatcher
(
node
,
Delta
)
{
let
ops
=
[]
//debugger
console
.
log
(
123
);
Delta
.
ops
.
forEach
(
op
=>
{
if
(
op
.
insert
&&
typeof
op
.
insert
===
'string'
)
{
// 如果粘贴了图片,这里会是一个对象,所以可以这样处理
ops
.
push
({
insert
:
op
.
insert
,
})
}
})
Delta
.
ops
=
ops
return
Delta
},
/** 初始化 商品详情 */
initInfo
()
{
this
.
goodsDeForm
.
description
=
''
;
...
...
@@ -121,7 +140,7 @@
}
else
{
this
.
$message
({
message
:
'上传失败,请重新上传'
,
type
:
'error'
});
}
this
.
loading
=
false
;
//
this.loading = false;
})
});
},
...
...
src/views/system/goods/add/components/goodsparameter.vue
浏览文件 @
77569b97
...
...
@@ -142,7 +142,6 @@
<!-- 查看各类价格说明 -->
<el-dialog
v-loading=
"loading"
title=
"各类价格说明"
:visible
.
sync=
"isViewPriceExp"
width=
"40%"
...
...
src/views/system/goodsimport/goodsgement.vue
浏览文件 @
77569b97
...
...
@@ -90,7 +90,7 @@
:disabled=
"multiple"
size=
"mini"
@
click=
"handleUpsale('9','up','all')"
>
批量上架
>
批量
申请
上架
</el-button>
<el-button
v-if=
'radiomodel==4'
...
...
@@ -164,7 +164,7 @@
size=
"mini"
type=
"text"
@
click=
"handleUpsale(scope.row,'up','one')"
>
上架
>
申请
上架
</el-button>
<el-button
v-if=
"radiomodel==4"
...
...
@@ -437,8 +437,11 @@
// });
});
},
// 下架/申请上架
handleUpsale
(
row
,
status
,
isall
)
{
//上下架
//debugger
//console.log(442,row);
let
good_id
,
is_onsale
,
title
,
message
if
(
isall
==
'one'
)
{
good_id
=
[
row
.
goods_id
]
...
...
src/views/system/goodsimport/index.vue
浏览文件 @
77569b97
...
...
@@ -51,6 +51,7 @@
</div>
</
template
>
<
script
>
import
{
MessageBox
}
from
'element-ui'
;
import
{
getShopInf
}
from
"@/api/module/entry"
import
{
goodsjdAddress
,
goodsimport
}
from
"@/api/module/goodsgement"
;
import
{
dateFormat
}
from
"@/utils"
;
...
...
@@ -98,7 +99,7 @@ export default {
let
urlarr
if
(
this
.
form
.
desc
)
{
urlarr
=
this
.
form
.
desc
.
split
(
','
)
debugger
//
debugger
if
(
urlarr
.
length
>
0
&&
urlarr
.
length
<=
10
)
{
if
(
Number
(
urlarr
.
length
)
>
Number
(
this
.
collect_num
))
{
this
.
$message
({
type
:
'warning'
,
message
:
'您好,准备导入的商品条数过多,当前剩余次数不足,请重新输入'
});
...
...
@@ -127,23 +128,57 @@ export default {
return
false
}
console
.
log
(
this
.
el_value
)
let
data
=
{
category_id
:
this
.
el_value
[
2
],
third_url
:
urlarr
}
goodsimport
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
1
)
{
this
.
$message
({
message
:
res
.
message
,
type
:
'success'
});
let
sucCount
=
0
;
let
allCount
=
Number
(
urlarr
.
length
);
//let failCount = 0;
let
msg
=
''
;
if
(
res
.
code
===
1
)
{
// 单条导入 提示语
if
(
allCount
===
1
)
{
if
(
Number
(
res
.
data
)
===
1
)
{
this
.
$message
({
type
:
'success'
,
message
:
'您好,商品已导入成功,请在仓库中进行编辑后申请上架'
});
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
'您好,商品导入失败,请您重新导入'
});
}
}
else
if
(
allCount
>
1
)
{
sucCount
=
Number
(
res
.
data
);
//failCount = this.minus( allCount, sucCount )
msg
=
"您好,一共导入"
+
allCount
+
"条商品,"
+
sucCount
+
"条导入成功,请在仓库中进行编辑后申请上架"
;
this
.
$message
({
type
:
'warning'
,
message
:
msg
})
}
this
.
el_value
=
[]
this
.
form
.
desc
=
''
this
.
info
()
}
})
},
// 自定义高精度浮点数运算
// 加法
add
(
arg1
,
arg2
)
{
let
r1
,
r2
,
m
,
result
;
try
{
//取小数位长度
r1
=
arg1
.
toString
().
split
(
"."
)[
1
].
length
;
r2
=
arg2
.
toString
().
split
(
"."
)[
1
].
length
;
}
catch
(
e
)
{
r1
=
0
;
r2
=
0
;
}
m
=
Math
.
pow
(
10
,
Math
.
max
(
r1
,
r2
));
//计算因子
result
=
(
arg1
*
m
+
arg2
*
m
)
/
m
;
result
=
result
.
toFixed
(
2
);
return
result
;
},
// 减法
minus
(
arg1
,
arg2
)
{
return
this
.
add
(
arg1
,
-
arg2
);
},
elvalueclick
()
{
// this.goodsonly()
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论