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
53a25e71
提交
53a25e71
authored
10月 24, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
ca537cc2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
27 行增加
和
33 行删除
+27
-33
edit.vue
src/views/commodityManage/edit.vue
+26
-33
shelves.vue
src/views/commodityManage/shelves.vue
+1
-0
没有找到文件。
src/views/commodityManage/edit.vue
浏览文件 @
53a25e71
...
@@ -76,15 +76,6 @@
...
@@ -76,15 +76,6 @@
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<!-- <el-form-item label="商品配件">
<el-tag v-for="tag in parts" :key="tag" closable type="primary" @close="handlePartsClose(tag)">
{{ tag }}
</el-tag>
<el-input v-if="newPartsVisible" ref="newKeywordInput" v-model="newPart" class="input-new-keyword"
@keyup.enter.native="handlePartsConfirm" @blur="handlePartsConfirm" />
<el-button v-else class="button-new-keyword" type="primary" @click="showPartsInput">+ 增加</el-button>
</el-form-item> -->
<el-form-item
label=
"所属分类"
>
<el-form-item
label=
"所属分类"
>
<el-cascader
v-model=
"categoryIds"
:options=
"categoryList"
expand-trigger=
"hover"
clearable
<el-cascader
v-model=
"categoryIds"
:options=
"categoryList"
expand-trigger=
"hover"
clearable
@
change=
"handleCategoryChange"
/>
@
change=
"handleCategoryChange"
/>
...
@@ -214,17 +205,12 @@ import { detailGoods, editGoods, listCatAndBrand } from "@/services/api/commodit
...
@@ -214,17 +205,12 @@ import { detailGoods, editGoods, listCatAndBrand } from "@/services/api/commodit
import
{
uploadPath
}
from
"@/services/api/storage"
;
import
{
uploadPath
}
from
"@/services/api/storage"
;
import
{
ElMessageBox
,
ElMessage
,
ElNotification
}
from
"element-plus"
;
import
{
ElMessageBox
,
ElMessage
,
ElNotification
}
from
"element-plus"
;
import
richTextEditor
from
'@/components/richTextEditor.vue'
import
richTextEditor
from
'@/components/richTextEditor.vue'
import
router
from
'@/router'
import
{
listGoods
}
from
"@/services/api/commodityManage/list"
;
import
{
listGoods
}
from
"@/services/api/commodityManage/list"
;
let
route
:
any
=
router
let
editDrawer
=
ref
(
false
)
let
editDrawer
=
ref
(
false
)
let
newKeywordVisible
=
ref
(
false
);
let
newKeywordVisible
=
ref
(
false
);
let
newPartsVisible
=
ref
(
false
);
let
newKeyword
=
ref
(
""
);
let
newKeyword
=
ref
(
""
);
let
keywords
=
ref
([]
as
any
);
let
keywords
=
ref
([]
as
any
);
let
parts
=
ref
([]
as
any
);
let
newPart
=
ref
(
""
);
let
galleryFileList
=
ref
([]
as
any
);
let
galleryFileList
=
ref
([]
as
any
);
let
categoryIds
=
ref
([]
as
any
);
let
categoryIds
=
ref
([]
as
any
);
let
categoryList
=
ref
([]
as
any
);
let
categoryList
=
ref
([]
as
any
);
...
@@ -272,7 +258,7 @@ let rules = ref({
...
@@ -272,7 +258,7 @@ let rules = ref({
let
headers
=
computed
(()
=>
{
let
headers
=
computed
(()
=>
{
return
{
Authorization
:
sessionStorage
.
getItem
(
"token"
)
};
return
{
Authorization
:
sessionStorage
.
getItem
(
"token"
)
};
});
});
let
emits
=
defineEmits
([
'initShelves'
])
let
partsList
=
ref
()
let
partsList
=
ref
()
let
initList
=
()
=>
{
let
initList
=
()
=>
{
listGoods
({
listGoods
({
...
@@ -291,6 +277,7 @@ initList()
...
@@ -291,6 +277,7 @@ initList()
let
init
=
(
id
:
number
)
=>
{
let
init
=
(
id
:
number
)
=>
{
detailGoods
(
id
).
then
((
res
)
=>
{
detailGoods
(
id
).
then
((
res
)
=>
{
goods
.
value
=
res
.
data
.
goods
;
goods
.
value
=
res
.
data
.
goods
;
partsList
.
value
=
res
.
data
.
parts
console
.
log
(
goods
.
value
);
console
.
log
(
goods
.
value
);
// 稍微调整一下前后端不一致
// 稍微调整一下前后端不一致
...
@@ -330,7 +317,27 @@ let handleCategoryChange = (value: any) => {
...
@@ -330,7 +317,27 @@ let handleCategoryChange = (value: any) => {
goods
.
value
.
categoryId
=
value
[
value
.
length
-
1
];
goods
.
value
.
categoryId
=
value
[
value
.
length
-
1
];
}
}
let
handleCancel
=
()
=>
{
let
handleCancel
=
()
=>
{
route
.
push
({
path
:
"/commodity/list"
});
goods
.
value
=
{
goodsSn
:
""
,
name
:
""
,
counterPrice
:
""
,
gallery
:
[]
as
any
,
isHot
:
false
,
isNew
:
true
,
isOnSale
:
true
,
picUrl
:
""
,
unit
:
""
,
brandId
:
""
,
brief
:
""
,
detail
:
'<p></p>'
,
categoryId
:
undefined
,
keywords
:
undefined
,
}
specifications
.
value
=
[]
products
.
value
=
[{
id
:
0
,
specifications
:
[
"标准"
],
price
:
0.0
,
number
:
0
,
url
:
""
},]
goodsParts
.
value
=
[]
attributes
.
value
=
[]
editDrawer
.
value
=
false
}
}
let
handleEdit
=
()
=>
{
let
handleEdit
=
()
=>
{
const
finalGoods
=
{
const
finalGoods
=
{
...
@@ -346,7 +353,8 @@ let handleEdit = () => {
...
@@ -346,7 +353,8 @@ let handleEdit = () => {
title
:
"成功"
,
title
:
"成功"
,
message
:
"编辑成功"
,
message
:
"编辑成功"
,
});
});
router
.
push
({
path
:
"/commodity/list"
});
emits
(
'initShelves'
)
handleCancel
()
})
})
.
catch
((
res
:
any
)
=>
{
.
catch
((
res
:
any
)
=>
{
ElMessageBox
.
alert
(
"业务错误:"
+
res
.
data
.
errmsg
,
"警告"
,
{
ElMessageBox
.
alert
(
"业务错误:"
+
res
.
data
.
errmsg
,
"警告"
,
{
...
@@ -360,16 +368,9 @@ let handleClose = (tag: any) => {
...
@@ -360,16 +368,9 @@ let handleClose = (tag: any) => {
goods
.
value
.
keywords
=
keywords
.
value
.
toString
();
goods
.
value
.
keywords
=
keywords
.
value
.
toString
();
}
}
let
handlePartsClose
=
(
tag
:
any
)
=>
{
parts
.
value
.
splice
(
parts
.
value
.
indexOf
(
tag
),
1
);
goods
.
value
.
parts
=
keywords
.
value
.
toString
();
}
let
showInput
=
()
=>
{
let
showInput
=
()
=>
{
newKeywordVisible
.
value
=
true
;
newKeywordVisible
.
value
=
true
;
}
}
let
showPartsInput
=
()
=>
{
newPartsVisible
.
value
=
true
;
}
let
handleInputConfirm
=
()
=>
{
let
handleInputConfirm
=
()
=>
{
const
newKeywords
:
string
=
newKeyword
.
value
;
const
newKeywords
:
string
=
newKeyword
.
value
;
if
(
newKeywords
)
{
if
(
newKeywords
)
{
...
@@ -379,15 +380,7 @@ let handleInputConfirm = () => {
...
@@ -379,15 +380,7 @@ let handleInputConfirm = () => {
newKeywordVisible
.
value
=
false
;
newKeywordVisible
.
value
=
false
;
newKeyword
.
value
=
""
;
newKeyword
.
value
=
""
;
}
}
let
handlePartsConfirm
=
()
=>
{
const
newParts
:
string
=
newPart
.
value
;
if
(
newParts
)
{
parts
.
value
.
push
(
newParts
);
goods
.
value
.
parts
=
parts
.
value
.
toString
();
}
newPartsVisible
.
value
=
false
;
newPart
.
value
=
""
;
}
let
uploadPicUrl
=
(
res
:
any
)
=>
{
let
uploadPicUrl
=
(
res
:
any
)
=>
{
goods
.
value
.
picUrl
=
res
.
data
.
url
;
goods
.
value
.
picUrl
=
res
.
data
.
url
;
}
}
...
...
src/views/commodityManage/shelves.vue
浏览文件 @
53a25e71
...
@@ -327,6 +327,7 @@ let handlePublish = () => {
...
@@ -327,6 +327,7 @@ let handlePublish = () => {
title
:
"成功"
,
title
:
"成功"
,
message
:
"创建成功"
,
message
:
"创建成功"
,
});
});
emits
(
'initShelves'
)
handleCancel
()
handleCancel
()
})
})
.
catch
((
res
)
=>
{
.
catch
((
res
)
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论