Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yongxinda-admin
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
yongxinda-admin
Commits
df1d40a7
提交
df1d40a7
authored
1月 04, 2023
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成排序问题
上级
379ab906
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
43 行增加
和
29 行删除
+43
-29
addSpecifications.vue
src/views/commodityManage/components/addSpecifications.vue
+3
-3
selectSpec.vue
src/views/commodityManage/components/selectSpec.vue
+20
-4
edit.vue
src/views/commodityManage/edit.vue
+20
-22
没有找到文件。
src/views/commodityManage/components/addSpecifications.vue
浏览文件 @
df1d40a7
...
...
@@ -45,9 +45,9 @@ let showVisiable = ref(false)
let
formRef
=
ref
()
let
title
=
ref
(
'添加规格属性'
)
let
rules
=
ref
({
bomCode
:
{
required
:
true
,
message
:
''
,
trigger
:
'blur'
},
model
:
{
required
:
true
,
message
:
''
,
trigger
:
'blur'
},
productName
:
{
required
:
true
,
message
:
''
,
trigger
:
'blur'
},
bomCode
:
{
required
:
true
,
message
:
'
BOM编码不为空
'
,
trigger
:
'blur'
},
model
:
{
required
:
true
,
message
:
'
型号不为空
'
,
trigger
:
'blur'
},
productName
:
{
required
:
true
,
message
:
'
商品货品名称不为空
'
,
trigger
:
'blur'
},
url
:
{
required
:
true
,
message
:
'产品图片不为空'
,
trigger
:
[
'blur'
,
'change'
]
},
designUrl
:
{
required
:
true
,
message
:
'设计图片不为空'
,
trigger
:
[
'blur'
,
'change'
]
}
})
...
...
src/views/commodityManage/components/selectSpec.vue
浏览文件 @
df1d40a7
...
...
@@ -127,7 +127,6 @@ let handleAscending = (item: any) => {
// 降序
let
handleDescending
=
(
item
:
any
)
=>
{
console
.
log
(
'descending'
);
emits
(
'handleSort'
,
'descending'
,
item
)
}
...
...
@@ -281,16 +280,33 @@ let showAddSpec = () => {
// 修改规格顺序时触发
let
sort
=
()
=>
{
let
resultSpecData
=
handleSpecData
()
specificationData
.
value
.
map
((
item
:
any
)
=>
{
specificationData
.
value
.
forEach
((
item
:
any
)
=>
{
specList
.
value
=
item
.
specifications
if
(
item
.
updateTime
)
item
.
updateTime
=
null
if
(
item
.
specifications
.
length
===
resultSpecData
.
length
)
handleSequence
(
resultSpecData
)
else
console
.
log
(
'少数量'
);
else
handleLessSequence
(
resultSpecData
)
item
.
specifications
=
specList
.
value
if
(
item
.
updateTime
)
item
.
updateTime
=
null
})
specList
.
value
=
[]
emits
(
'productsData'
,
specificationData
.
value
)
}
// 处理少的顺序
let
handleLessSequence
=
(
data
:
any
)
=>
{
let
specListCopy
=
[...
specList
.
value
]
// 浅拷贝
let
list
=
[]
as
any
// 存储有的数组
data
.
map
((
item
:
any
,
i
:
number
)
=>
{
item
.
value
.
map
((
item1
:
any
)
=>
{
let
index
=
specListCopy
.
indexOf
(
item1
)
if
(
index
!==
-
1
)
// 去除重复规格属性
if
(
list
.
indexOf
(
specListCopy
[
index
])
===
-
1
)
list
.
push
(
specListCopy
[
index
])
})
})
specList
.
value
=
list
}
// 添加规格属性
let
clickAdd
=
(
formData
:
any
)
=>
{
let
data
=
{
...
...
src/views/commodityManage/edit.vue
浏览文件 @
df1d40a7
...
...
@@ -431,7 +431,7 @@ let handleSort = (type: string, data: any) => {
if
(
item
.
updateTime
)
item
.
updateTime
=
null
}
});
console
.
log
(
specifications
.
value
,
data
);
//
console.log(specifications.value, data);
bubbleSort
(
specifications
.
value
)
selectSpecRef
.
value
.
setSpecifications
(
products
.
value
)
}
else
{
...
...
@@ -456,7 +456,7 @@ let handleSort = (type: string, data: any) => {
if
(
item
.
updateTime
)
item
.
updateTime
=
null
}
});
console
.
log
(
specifications
.
value
,
data
);
//
console.log(specifications.value, data);
bubbleSort
(
specifications
.
value
)
}
}
...
...
@@ -570,28 +570,26 @@ let handleEdit = () => {
categoryIds
:
categoryIds
.
value
,
parts
:
partsData
.
value
};
editGoods
(
finalGoods
)
.
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
200
)
{
ElNotification
({
type
:
'success'
,
title
:
"成功"
,
message
:
"编辑成功"
,
});
emits
(
'initShelves'
)
handleCancel
()
}
else
if
(
res
.
code
===
401
)
{
// 因为会有拦截所以的刷新数据
specificationsDeleteData
.
value
=
[]
init
(
specQueryId
.
value
)
}
})
.
catch
((
res
:
any
)
=>
{
ElMessageBox
.
alert
(
"业务错误:"
+
res
.
msg
,
"警告"
,
{
confirmButtonText
:
"确定"
,
type
:
"error"
,
editGoods
(
finalGoods
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
200
)
{
ElNotification
({
type
:
'success'
,
title
:
"成功"
,
message
:
"编辑成功"
,
});
emits
(
'initShelves'
)
handleCancel
()
}
else
if
(
res
.
code
===
401
)
{
// 因为会有拦截所以的刷新数据
specificationsDeleteData
.
value
=
[]
init
(
specQueryId
.
value
)
}
}).
catch
((
res
:
any
)
=>
{
ElMessageBox
.
alert
(
"业务错误:"
+
res
.
msg
,
"警告"
,
{
confirmButtonText
:
"确定"
,
type
:
"error"
,
});
});
}
else
return
false
})
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论