Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
提交
议题看板
打开侧边栏
jingqi.liu
pica.cloud.web-education-admin
提交
24905b74
提交
24905b74
编写于
1月 26, 2022
作者:
changdi.hao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复浮点字符的问题
上级
3921bb7c
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
24 行增加
和
3 行删除
+24
-3
utils.js
src/utils/utils.js
+20
-0
create-good.vue
src/views/goods/create-good.vue
+4
-3
未找到文件。
src/utils/utils.js
浏览文件 @
24905b74
...
...
@@ -808,3 +808,23 @@ export const setOptionLabel = (self,selfModel,selfEId,selfEName,list,listEId,lis
export
function
deepCopy
(
obj
)
{
return
obj
?
JSON
.
parse
(
JSON
.
stringify
(
obj
))
:
obj
;
}
//按照有效数字位数进行四舍五入,默认6位有效数字
export
function
signFigures
(
num
,
rank
=
6
){
if
(
!
num
)
return
(
0
);
const
sign
=
num
/
Math
.
abs
(
num
);
const
number
=
num
*
sign
;
const
temp
=
rank
-
1
-
Math
.
floor
(
Math
.
log10
(
number
));
let
ans
;
if
(
temp
>
0
)
{
ans
=
parseFloat
(
number
.
toFixed
(
temp
));
}
else
if
(
temp
<
0
)
{
ans
=
Math
.
round
(
number
/
Math
.
pow
(
10
,
temp
))
*
temp
;
}
else
{
ans
=
Math
.
round
(
number
);
}
return
(
ans
*
sign
);
};
src/views/goods/create-good.vue
浏览文件 @
24905b74
...
...
@@ -867,7 +867,7 @@
<
script
>
import
BreadCrumb
from
"@/components/breadcrumb.vue"
;
let
vm
=
null
;
import
{
openLoading
,
closeLoading
}
from
"../../utils/utils"
;
import
{
openLoading
,
closeLoading
,
signFigures
}
from
"../../utils/utils"
;
import
{
isEmptyUtils
}
from
"@/utils/index"
;
import
{
doUpload
,
getFilePath
,
createFilePath
}
from
"../../utils/qiniu-util"
;
import
{
updateGoods
,
updateStock
,
dosageAll
,
getDeparts
,
getGoodsList
,
getGoodDetails
,
updateGoodsV2
,
getHospitalInfoByStoreId
,
getCheckPackageIdList
,
getTypeCodeList
,
getBusinessCategory
}
from
'@/utils/goods'
;
...
...
@@ -1535,10 +1535,11 @@
return
;
}
}
if
(
!
isTrue
){
return
false
;
}
else
{
this
.
formData
.
costPrice
=
this
.
formData
.
optPrice
*
100
this
.
formData
.
costPrice
=
signFigures
(
this
.
formData
.
optPrice
*
100
);
this
.
formData
.
hasChanged
=
true
;
this
.
formData
.
inputType
=
this
.
inputType
;
this
.
updateGoodsInfo
();
...
...
@@ -1560,7 +1561,7 @@
updateGoodsInfo
(){
console
.
log
(
'提交值'
,
JSON
.
parse
(
JSON
.
stringify
(
this
.
formData
)));
const
submieFn
=
this
.
isCheckServe
?
updateGoodsV2
:
updateGoods
;
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
formData
))
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
formData
))
;
params
.
scorePerformance
=
params
.
scorePerformance
*
100
;
submieFn
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
!==
'000000'
)
{
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录