Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_admin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_admin
Commits
d8abaf84
Commit
d8abaf84
authored
Aug 29, 2023
by
yaya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:钱币设置添加删除功能
parent
1da85189
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
14 deletions
+85
-14
src/api/business/goodsNew.js
src/api/business/goodsNew.js
+8
-0
src/views/goods/infoSet.vue
src/views/goods/infoSet.vue
+77
-14
No files found.
src/api/business/goodsNew.js
View file @
d8abaf84
...
...
@@ -31,3 +31,11 @@ export function saveCroppingRecord(params) {
data
:
params
})
}
export
function
deleteGood
(
params
)
{
return
request
({
url
:
'
/item/delete
'
,
method
:
'
post
'
,
data
:
params
})
}
src/views/goods/infoSet.vue
View file @
d8abaf84
<
template
>
<div
ref=
"scrollRef"
class=
"app-container"
>
<div
ref=
"top"
:class=
"
{fixed: isFixed}" class="op-container" style="margin-bottom: 20px">
<el-button
round
type=
"danger"
@
click=
"handleDelete"
>
删除
</el-button>
<el-button
round
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
round
@
click=
"handlePublish"
>
发布
</el-button>
<el-button
type=
"primary"
style=
"margin-right: 20px"
round
@
click=
"handleEdit"
>
编辑
</el-button>
<el-button-group>
<el-button
:disabled=
"previousDisabled"
type=
"primary"
icon=
"el-icon-arrow-left"
@
click=
"handlePrevious"
>
上一个
</el-button>
<el-button
type=
"primary"
@
click=
"handleNext"
>
下一个
<i
class=
"el-icon-arrow-right el-icon--right"
/></el-button>
<el-button
:disabled=
"previousDisabled"
type=
"primary"
icon=
"el-icon-arrow-left"
@
click=
"handlePrevious"
>
上一个
</el-button>
<el-button
type=
"primary"
@
click=
"handleNext"
>
下一个
<i
class=
"el-icon-arrow-right el-icon--right"
/></el-button>
</el-button-group>
</div>
<el-card
class=
"detail-card"
>
<div
class=
"detail"
>
<div
class=
"desc"
>
<div
class=
"desc"
>
<div
class=
"detail_title"
style=
"min-width: 80px; text-align: end"
>
钱币名称:
</div>
<div
class=
"detail_title"
>
{{
goodsParams
.
name
}}
</div>
</div>
...
...
@@ -25,7 +27,7 @@
<div
class=
"detail_image"
>
<div
class=
"detail_title"
>
{{
`钱币图片:`
}}
</div>
<div
class=
"list"
>
<div
v-for=
"(item, index) in imageList"
:key=
"item + index"
class=
"select_item"
>
<div
v-for=
"(item, index) in imageList"
:key=
"item + index"
class=
"select_item"
>
<img
:src=
"item"
class=
"gallery"
@
click=
"handleShowLargeDialog(item)"
>
<div
class=
"edit"
@
click=
"handlerChangeImage(item)"
>
编辑
</div>
</div>
...
...
@@ -83,7 +85,7 @@
v-if=
"compositeImageSrc"
:href=
"compositeImageSrc"
:style=
"
{'background-image': `url(${compositeImageSrc})`}"
class="image"/>
class="image"
/>
</div>
</div>
...
...
@@ -102,16 +104,31 @@
:style=
"
{ 'width':'300px' }"
expand-trigger="hover"
placeholder="请选择钱币分类"
@change="handleCategoryChange"/>
@change="handleCategoryChange"
/>
</el-form-item>
<el-form-item
label=
"直径(mm):"
prop=
"name"
>
<el-input
v-model=
"goodsParams.diameter"
:style=
"
{ 'width':'300px' }" placeholder="请输入直径(mm)" type="number" @input="limitInput($event, 1)"/>
<el-input
v-model=
"goodsParams.diameter"
:style=
"
{ 'width':'300px' }"
placeholder="请输入直径(mm)"
type="number"
@input="limitInput($event, 1)" />
</el-form-item>
<el-form-item
label=
"厚度(mm):"
prop=
"name"
>
<el-input
v-model=
"goodsParams.thickness"
:style=
"
{ 'width':'300px' }" placeholder="请输入厚度(mm)" type="number" @input="limitInput($event, 2)"/>
<el-input
v-model=
"goodsParams.thickness"
:style=
"
{ 'width':'300px' }"
placeholder="请输入厚度(mm)"
type="number"
@input="limitInput($event, 2)" />
</el-form-item>
<el-form-item
label=
"质量(g):"
prop=
"name"
>
<el-input
v-model=
"goodsParams.weight"
:style=
"
{ 'width':'300px' }" placeholder="请输入质量(g)" type="number" @input="limitInput($event, 3)"/>
<el-input
v-model=
"goodsParams.weight"
:style=
"
{ 'width':'300px' }"
placeholder="请输入质量(g)"
type="number"
@input="limitInput($event, 3)" />
</el-form-item>
<el-form-item
label=
"是否作为标准货币:"
prop=
"isOnSale"
>
<el-radio-group
v-model=
"goodsParams.isStd"
>
...
...
@@ -125,7 +142,7 @@
:rows=
"5"
maxlength=
"50"
type=
"textarea"
placeholder=
"请输入备注(最多50个字)"
/>
placeholder=
"请输入备注(最多50个字)"
/>
</el-form-item>
</el-form>
</div>
...
...
@@ -150,14 +167,14 @@
:show-cut-dialog=
"cutImageDialogVisible"
@
cutImageDialogClose=
"cutImageDialogVisible = false"
@
cutSuccess=
"handleCutSuccess"
@
uploadImage=
"handleUploadImage"
/>
@
uploadImage=
"handleUploadImage"
/>
<CutEditImageDialog
v-if=
"cutEditImageDialogVisible"
:edit-image-url=
"editImageUrl"
:show-cut-dialog=
"cutImageDialogVisible"
@
cutEditImageDialogClose=
"cutEditImageDialogVisible = false"
@
cutEditSuccess=
"handleSaveImageBase64"
@
uploadEditImage=
"handleUploadImage"
/>
@
uploadEditImage=
"handleUploadImage"
/>
</div>
</
template
>
...
...
@@ -167,14 +184,22 @@ import { VuePictureCut, VuePictureCutMask, VuePictureCutMenu } from 'vue-picture
import
{
getToken
}
from
'
@/utils/auth
'
import
SelectImageDialog
from
'
./components/selectImageDialog
'
import
{
listCategories
}
from
'
@/api/business/goods
'
import
{
detailGoods
,
editGoods
,
saveImageBase64
,
saveCroppingRecord
}
from
'
@/api/business/goodsNew
'
import
{
detailGoods
,
editGoods
,
saveImageBase64
,
saveCroppingRecord
,
deleteGood
}
from
'
@/api/business/goodsNew
'
import
CheckLargeImageDialog
from
'
./components/CheckLargeImageDialog
'
import
CutImageDialog
from
'
./components/CutImageDialog
'
import
CutEditImageDialog
from
'
./components/CutEditImageDialog
'
export
default
{
name
:
'
InfoSet
'
,
components
:
{
CutEditImageDialog
,
CutImageDialog
,
CheckLargeImageDialog
,
SelectImageDialog
,
VuePictureCut
,
VuePictureCutMask
,
VuePictureCutMenu
},
components
:
{
CutEditImageDialog
,
CutImageDialog
,
CheckLargeImageDialog
,
SelectImageDialog
,
VuePictureCut
,
VuePictureCutMask
,
VuePictureCutMenu
},
filters
:
{
trimHtml
(
html_str
)
{
var
text
=
html_str
&&
html_str
.
replace
(
/<
[^
<>
]
+>/g
,
''
)
||
''
...
...
@@ -320,6 +345,35 @@ export default {
this
.
compositeImageSrc
=
''
this
.
categoryIds
=
[]
},
// 删除
handleDelete
()
{
this
.
$confirm
(
'
删除后不可恢复!
'
,
'
是否要删除该藏品?
'
,
{
confirmButtonText
:
'
删除
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
}).
then
(()
=>
{
const
params
=
{
id
:
this
.
goodsParams
.
id
}
deleteGood
(
params
).
then
(
response
=>
{
this
.
$message
.
success
(
'
删除成功
'
)
console
.
log
(
'
===原来=list ===
'
,
this
.
goodIdList
)
this
.
goodIdList
=
this
.
goodIdList
.
filter
((
item
)
=>
{
if
(
item
!==
this
.
goodsParams
.
id
)
{
return
item
}
})
this
.
currentIndex
-=
1
this
.
handleNext
()
console
.
log
(
'
===现在=list ===
'
,
this
.
goodIdList
)
}).
catch
(
response
=>
{
this
.
$notify
.
error
({
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
||
'
请求失败
'
})
})
})
},
// 取消,回到钱币列表页
handleCancel
()
{
this
.
$router
.
push
({
path
:
'
/goods/list
'
})
...
...
@@ -534,6 +588,7 @@ export default {
.op-container
{
text-align
:
right
;
}
.fixed
{
position
:
fixed
;
top
:
20px
;
...
...
@@ -552,6 +607,7 @@ export default {
flex-direction
:
row
;
align-content
:
start
;
margin-top
:
15px
;
.detail_desc-content
{
font-weight
:
normal
;
font-size
:
16px
;
...
...
@@ -560,9 +616,11 @@ export default {
}
}
.detail_desc-html
{
width
:
auto
;
}
.detail_title
{
font-weight
:
bold
;
...
...
@@ -572,16 +630,20 @@ export default {
font-weight
:
normal
;
font-size
:
16px
;
}
.detail_image
{
display
:
flex
;
flex-direction
:
row
;
.detail_title
{
width
:
100px
;
font-weight
:
normal
;
margin-top
:
15px
;
}
.list
{
margin-top
:
10px
;
.select_item
{
width
:
100px
;
height
:
100px
;
...
...
@@ -595,6 +657,7 @@ export default {
height
:
100px
;
object-fit
:
contain
;
}
.edit
{
position
:
absolute
;
top
:
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment