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
4043eb1b
Commit
4043eb1b
authored
Mar 05, 2024
by
yaya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加分销商品添加发布功能
parent
bafc1686
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
73 deletions
+83
-73
src/api/business/sale.js
src/api/business/sale.js
+7
-0
src/views/sale/saleAdd.vue
src/views/sale/saleAdd.vue
+75
-23
src/views/sale/saleList.vue
src/views/sale/saleList.vue
+1
-50
No files found.
src/api/business/sale.js
View file @
4043eb1b
...
...
@@ -7,6 +7,13 @@ export function createSale(data) {
data
})
}
export
function
updateSale
(
data
)
{
return
request
({
url
:
'
/supplierItem/update
'
,
method
:
'
post
'
,
data
})
}
export
function
getSaleList
(
data
)
{
return
request
({
url
:
'
/supplierItem/findList
'
,
...
...
src/views/sale/saleAdd.vue
View file @
4043eb1b
...
...
@@ -59,7 +59,7 @@
<h5>
限购
</h5>
<el-form-item
label=
""
prop=
"numType"
>
<div
class=
"item"
>
<el-radio-group
v-model=
"numType"
>
<el-radio-group
v-model=
"numType"
@
change=
"handlerNumTypeChange"
>
<el-radio
:label=
"-1"
>
不限
</el-radio>
<el-radio
:label=
"2"
>
自定义
</el-radio>
</el-radio-group>
...
...
@@ -127,7 +127,7 @@ import { uploadPath, createStorage } from '@/api/business/storage'
import
{
getToken
}
from
'
@/utils/auth
'
import
Editor
from
'
@tinymce/tinymce-vue
'
import
{
MessageBox
}
from
'
element-ui
'
import
{
createSale
,
findSaleDetail
}
from
'
../../api/business/sale
'
import
{
createSale
,
findSaleDetail
,
updateSale
}
from
'
../../api/business/sale
'
export
default
{
name
:
'
SaleAdd
'
,
...
...
@@ -156,9 +156,9 @@ export default {
name
:
[{
required
:
true
,
message
:
'
商品名称不能为空
'
,
trigger
:
'
blur
'
}],
distributionPrice
:
[{
required
:
true
,
message
:
'
供货价不能为空
'
,
trigger
:
'
blur
'
}],
// buyLimitNum: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
auctionStartTime
:
[{
required
:
true
,
message
:
'
开始不能为空
'
,
trigger
:
'
blur
'
}],
auctionEndTime
:
[{
required
:
true
,
message
:
'
开始
不能为空
'
,
trigger
:
'
blur
'
}],
startPrice
:
[{
required
:
true
,
message
:
'
结束时间
不能为空
'
,
trigger
:
'
blur
'
}],
auctionStartTime
:
[{
required
:
true
,
message
:
'
开始
时间
不能为空
'
,
trigger
:
'
blur
'
}],
auctionEndTime
:
[{
required
:
true
,
message
:
'
截拍时间
不能为空
'
,
trigger
:
'
blur
'
}],
startPrice
:
[{
required
:
true
,
message
:
'
起拍价
不能为空
'
,
trigger
:
'
blur
'
}],
addExtent
:
[{
required
:
true
,
message
:
'
加价幅度不能为空
'
,
trigger
:
'
blur
'
}]
},
editorInit
:
{
...
...
@@ -207,12 +207,35 @@ export default {
this
.
handleGetDetail
(
loading
)
},
methods
:
{
handlerNumTypeChange
(
e
)
{
console
.
log
(
'
==e==
'
,
e
)
},
/**
* 获取详情
* @param loading
*/
handleGetDetail
(
loading
)
{
findSaleDetail
({
id
:
this
.
id
})
.
then
(
response
=>
{
if
(
loading
)
{
loading
.
close
()
}
console
.
log
(
'
====
'
,
response
.
data
.
data
)
if
(
response
.
data
.
data
)
{
this
.
goods
=
response
.
data
.
data
if
(
!
response
.
data
.
data
.
buyLimitNum
||
response
.
data
.
data
.
buyLimitNum
===
-
1
)
{
this
.
goods
.
buyLimitNum
=
0
this
.
numType
=
-
1
this
.
goods
.
images
=
response
.
data
.
data
.
images
?
response
.
data
.
data
.
images
.
split
(
'
;
'
)
:
[]
if
(
this
.
goods
.
images
&&
this
.
goods
.
images
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
this
.
goods
.
images
.
length
;
i
++
)
{
this
.
itemImages
.
push
({
url
:
this
.
goods
.
images
[
i
]
})
}
}
}
}
})
.
catch
(
response
=>
{
if
(
loading
)
{
...
...
@@ -220,6 +243,9 @@ export default {
}
})
},
/**
* 返回
*/
handleBack
()
{
if
(
this
.
$route
.
query
.
noGoBack
)
{
this
.
$router
.
push
({
path
:
'
/dashboard
'
})
...
...
@@ -227,12 +253,39 @@ export default {
this
.
$router
.
go
(
-
1
)
}
},
/**
* 保存
*/
handleSave
()
{
if
(
this
.
goods
.
images
.
length
===
0
)
{
this
.
$message
({
type
:
'
error
'
,
message
:
'
最少上传1张图片!
'
})
return
}
this
.
goods
.
images
=
this
.
goods
.
images
.
join
(
'
;
'
)
this
.
$refs
.
goods
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
numType
===
-
1
)
{
this
.
goods
.
buyLimitNum
=
-
1
}
if
(
this
.
id
)
{
updateSale
(
this
.
goods
)
.
then
(
response
=>
{
this
.
$notify
.
success
({
title
:
'
成功
'
,
message
:
'
编辑成功
'
})
this
.
$router
.
push
({
path
:
'
/sale/saleList
'
})
})
.
catch
(
response
=>
{
MessageBox
.
alert
(
'
业务错误:
'
+
response
.
data
.
errmsg
,
'
警告
'
,
{
confirmButtonText
:
'
确定
'
,
type
:
'
error
'
})
})
}
else
{
createSale
(
this
.
goods
)
.
then
(
response
=>
{
this
.
$notify
.
success
({
...
...
@@ -248,8 +301,13 @@ export default {
})
})
}
}
})
},
/**
* 金额输入
* @param value
*/
limitInput
(
value
)
{
this
.
goods
.
price
=
(
''
+
value
)
// 第一步:转成字符串
.
replace
(
/
[^\d
^
\.]
+/g
,
''
)
// 第二步:把不是数字,不是小数点的过滤掉
...
...
@@ -275,17 +333,11 @@ export default {
}
else
{
url
=
file
.
response
.
data
.
url
}
if
(
url
===
this
.
goods
.
topImage
)
{
this
.
goods
.
topImage
=
''
}
for
(
var
i
=
0
;
i
<
this
.
goods
.
images
.
length
;
i
++
)
{
// 这里存在两种情况
// 1. 如果所删除图片是刚刚上传的图片,那么图片地址是file.response.data.url
// 此时的file.url虽然存在,但是是本机地址,而不是远程地址。
// 2. 如果所删除图片是后台返回的已有图片,那么图片地址是file.url
if
(
url
===
this
.
goods
.
topImage
)
{
this
.
goods
.
topImage
=
''
}
if
(
this
.
goods
.
images
[
i
]
===
url
)
{
this
.
goods
.
images
.
splice
(
i
,
1
)
}
...
...
src/views/sale/saleList.vue
View file @
4043eb1b
...
...
@@ -19,7 +19,7 @@
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"标题"
prop=
"name"
>
<el-table-column
align=
"center"
label=
"标题"
min-width=
"150px"
prop=
"name"
>
<
template
slot-scope=
"scope"
>
<Line2Hidden
:text=
"scope.row.name"
/>
</
template
>
...
...
@@ -203,55 +203,6 @@ export default {
}
)
}
)
}
)
}
,
/**
* 货品签收
*/
handleConfirmReceive
(
item
)
{
/*
const params = { saleId: item.saleId
}
confirmReceive(params)
.then(response => {
this.$notify.success({
message: '货品签收成功'
}
)
this.getList()
}
)
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
}
)
}
)*/
}
,
/**
* 实物评估
*/
handleIdentifyValueDialogShow
(
item
)
{
this
.
identifyValueDialogShow
=
true
this
.
currentSaleId
=
item
.
saleId
}
,
/**
* 货品售出
*/
handleFinishDialogShow
(
item
)
{
this
.
finishDialogShow
=
true
this
.
currentSaleId
=
item
.
saleId
}
,
/**
* 待用户结款
*/
handleFinishSettlementDialogShow
(
item
)
{
this
.
finishSettlementDialogShow
=
true
this
.
currentSaleId
=
item
.
saleId
}
,
/**
* 取消寄售
*/
handleCancelDialogShow
(
item
)
{
this
.
cancelConsignDialogShow
=
true
this
.
currentSaleId
=
item
.
saleId
}
}
}
...
...
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