Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-discover
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 06a1f751
authored
Jul 12, 2023
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
更换接口
1 parent
0dfdb937
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
14 deletions
src/api/modules/goods.js
src/views/goods/add.vue
src/views/goods/components/selectMerchantDialog.vue
src/views/goods/index.vue
src/api/modules/goods.js
View file @
06a1f75
...
@@ -65,11 +65,22 @@ const getGoodsDetail = params => {
...
@@ -65,11 +65,22 @@ const getGoodsDetail = params => {
}
}
const
getMerchantListApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.goods.smartcarlife.detail'
return
http
({
url
,
method
:
'post'
,
data
:
params
,
sign
:
true
})
}
export
default
{
export
default
{
getGoodsListApi
,
getGoodsListApi
,
updateGoodsStatusApi
,
updateGoodsStatusApi
,
delGoodsApi
,
delGoodsApi
,
getCarlifeGoodsApi
,
getCarlifeGoodsApi
,
addGoodsApi
,
addGoodsApi
,
getGoodsDetail
getGoodsDetail
,
getMerchantListApi
}
}
\ No newline at end of file
\ No newline at end of file
src/views/goods/add.vue
View file @
06a1f75
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
</GLFooter>
</GLFooter>
<selectCarDialog
v-if=
"carDialogVisible"
:echoData=
"vehicleSeriesRequestList"
@
handleClose=
"handleCarSeriesClose"
@
handleConfirm=
"handleConfirm"
:dialogVisible=
"carDialogVisible"
></selectCarDialog>
<selectCarDialog
v-if=
"carDialogVisible"
:echoData=
"vehicleSeriesRequestList"
@
handleClose=
"handleCarSeriesClose"
@
handleConfirm=
"handleConfirm"
:dialogVisible=
"carDialogVisible"
></selectCarDialog>
<selectGoods
v-if=
"goodsVisible"
:dialogVisible=
"goodsVisible"
:goodsInfo=
"formObj"
@
handleGoodsConfirm=
"handleGoodsConfirm"
@
handleGoodsClose=
"handleGoodsClose"
></selectGoods>
<selectGoods
v-if=
"goodsVisible"
:dialogVisible=
"goodsVisible"
:goodsInfo=
"formObj"
@
handleGoodsConfirm=
"handleGoodsConfirm"
@
handleGoodsClose=
"handleGoodsClose"
></selectGoods>
<selectMerchantDialog
@
confirmDialog=
"confirmDialog"
@
closeDialog=
"closeDialog"
:selectedList=
"merchantRequestList"
v-if=
"merchantDialogVisible"
:isVisible=
"merchantDialogVisible"
></selectMerchantDialog>
<selectMerchantDialog
@
confirmDialog=
"confirmDialog"
@
closeDialog=
"closeDialog"
:
goodsId=
"formObj.smartcarlifeInfoId"
:
selectedList=
"merchantRequestList"
v-if=
"merchantDialogVisible"
:isVisible=
"merchantDialogVisible"
></selectMerchantDialog>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
...
@@ -297,6 +297,7 @@ export default {
...
@@ -297,6 +297,7 @@ export default {
this
.
goodsVisible
=
false
this
.
goodsVisible
=
false
},
},
handleGoodsConfirm
(
e
){
handleGoodsConfirm
(
e
){
if
(
this
.
formObj
.
smartcarlifeInfoId
!=
e
?.
id
)
this
.
merchantRequestList
=
[]
let
{
id
:
smartcarlifeInfoId
,
goodsName
,
goodsImage
,
minSellPrice
,
retailPrice
}
=
e
||
{}
let
{
id
:
smartcarlifeInfoId
,
goodsName
,
goodsImage
,
minSellPrice
,
retailPrice
}
=
e
||
{}
minSellPrice
=
minSellPrice
?
Number
(
Number
(
minSellPrice
/
100
).
toFixed
(
2
))
:
0
minSellPrice
=
minSellPrice
?
Number
(
Number
(
minSellPrice
/
100
).
toFixed
(
2
))
:
0
retailPrice
=
retailPrice
?
Number
(
Number
(
retailPrice
/
100
).
toFixed
(
2
))
:
0
retailPrice
=
retailPrice
?
Number
(
Number
(
retailPrice
/
100
).
toFixed
(
2
))
:
0
...
@@ -327,13 +328,14 @@ export default {
...
@@ -327,13 +328,14 @@ export default {
this
.
handleCarSeriesClose
()
this
.
handleCarSeriesClose
()
},
},
confirmDialog
(
e
){
confirmDialog
(
e
){
console
.
log
(
e
)
this
.
merchantRequestList
=
e
||
[]
this
.
merchantRequestList
=
e
||
[]
this
.
closeDialog
()
this
.
closeDialog
()
},
},
closeDialog
(){
closeDialog
(){
if
(
!
this
.
merchantDialogVisible
&&
!
this
.
formObj
.
smartcarlifeInfoId
){
return
this
.
$message
.
error
(
'请先选择商品'
)
}
this
.
merchantDialogVisible
=
!
this
.
merchantDialogVisible
this
.
merchantDialogVisible
=
!
this
.
merchantDialogVisible
console
.
log
(
this
.
merchantDialogVisible
)
},
},
handleDel
(
row
)
{
handleDel
(
row
)
{
const
idx
=
this
.
merchantRequestList
.
findIndex
(
item
=>
item
.
id
==
row
.
id
)
const
idx
=
this
.
merchantRequestList
.
findIndex
(
item
=>
item
.
id
==
row
.
id
)
...
@@ -354,13 +356,17 @@ export default {
...
@@ -354,13 +356,17 @@ export default {
delete
obj
.
coverList
delete
obj
.
coverList
let
merchantRequestList
=
this
.
merchantRequestList
.
map
(
item
=>
{
let
merchantRequestList
=
this
.
merchantRequestList
.
map
(
item
=>
{
let
{
merchantNo
,
merchantId
,
merchantName
,
activityPrice
}
=
item
let
{
merchantId
,
merchantName
,
activityPrice
}
=
item
merchantId
=
merchantNo
||
merchantId
let
price
=
this
.
formObj
.
paymentType
==
1
?
0
:
this
.
formObj
.
depositPrice
let
price
=
this
.
formObj
.
paymentType
==
1
?
0
:
this
.
formObj
.
depositPrice
let
retainagePrice
=
activityPrice
-
price
let
retainagePrice
=
activityPrice
-
price
activityPrice
=
activityPrice
?
Number
(
Number
(
activityPrice
*
10
*
10
).
toFixed
(
0
))
:
0
activityPrice
=
activityPrice
?
Number
(
Number
(
activityPrice
*
10
*
10
).
toFixed
(
0
))
:
0
retainagePrice
=
retainagePrice
?
Number
(
Number
(
retainagePrice
*
10
*
10
).
toFixed
(
0
))
:
0
retainagePrice
=
retainagePrice
?
Number
(
Number
(
retainagePrice
*
10
*
10
).
toFixed
(
0
))
:
0
return
{
merchantId
,
merchantName
,
activityPrice
,
retainagePrice
}
if
(
obj
.
paymentType
==
1
)
{
return
{
merchantId
,
merchantName
,
activityPrice
}
}
else
{
return
{
merchantId
,
merchantName
,
activityPrice
,
retainagePrice
}
}
})
})
const
params
=
{
const
params
=
{
merchantRequestList
,
merchantRequestList
,
...
@@ -373,7 +379,6 @@ export default {
...
@@ -373,7 +379,6 @@ export default {
handleSave
(){
handleSave
(){
this
.
$refs
.
baseInfoRef
.
$refs
.
formRef
.
validate
(
valid
=>
{
this
.
$refs
.
baseInfoRef
.
$refs
.
formRef
.
validate
(
valid
=>
{
if
(
valid
){
if
(
valid
){
console
.
log
(
this
.
getParams
())
const
params
=
this
.
getParams
()
const
params
=
this
.
getParams
()
this
.
$apis
.
goods
.
addGoodsApi
(
params
).
then
(
res
=>
{
this
.
$apis
.
goods
.
addGoodsApi
(
params
).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
...
...
src/views/goods/components/selectMerchantDialog.vue
View file @
06a1f75
<
template
>
<
template
>
<GLDialog
bigTitle=
"选择商品优惠券"
mode=
"big"
:visible
.
sync=
"isVisible"
:show-close=
"true"
:before-close=
"handleClose"
:close-on-click-modal=
"false"
@
onOk=
"onOk"
@
onCancel=
"handleClose"
>
<GLDialog
bigTitle=
"选择商品优惠券"
mode=
"big"
:visible
.
sync=
"isVisible"
:show-close=
"true"
:before-close=
"handleClose"
:close-on-click-modal=
"false"
@
onOk=
"onOk"
@
onCancel=
"handleClose"
>
<div
class=
"dialog_body"
>
<div
class=
"dialog_body"
>
<
GLCombiForm
:rowNumber=
"1"
class=
"dialog_search"
ref=
"searchRef"
:formObj=
"dialogSearchForm"
:formData=
"dialogFormData"
@
handleOk=
"handleOk"
@
handleRest=
"handleRest"
></GLCombiForm
>
<
!--
<GLCombiForm
:rowNumber=
"1"
class=
"dialog_search"
ref=
"searchRef"
:formObj=
"dialogSearchForm"
:formData=
"dialogFormData"
@
handleOk=
"handleOk"
@
handleRest=
"handleRest"
></GLCombiForm>
--
>
<div
class=
"dialog_table"
>
<div
class=
"dialog_table"
>
<GLTable
v-if=
"showTable"
:
pageSizes=
"pageSizes"
ref=
"tableRef
"
:pageConf=
"pageConf"
@
setTableFinishFun=
"setTableFinishFun"
:searchForm=
"dialogSearchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
>
<GLTable
v-if=
"showTable"
:
hasPage=
"false"
:pageSizes=
"pageSizes"
ref=
"tableRef"
:beforeSearchFn=
"beforeSearchFn
"
:pageConf=
"pageConf"
@
setTableFinishFun=
"setTableFinishFun"
:searchForm=
"dialogSearchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
>
<div
slot=
"spreadPrice"
slot-scope=
"scope"
>
<div
slot=
"spreadPrice"
slot-scope=
"scope"
>
<span
:style=
"
{ color: Number(scope.scope.lineationPrice - scope.scope.costPrice)
<
= 0 ? '#eb4e4e' : '#666666' }">
{{
Number
(
Number
(
scope
.
scope
.
lineationPrice
-
scope
.
scope
.
costPrice
).
toFixed
(
1
))
}}
</span>
<span
:style=
"
{ color: Number(scope.scope.lineationPrice - scope.scope.costPrice)
<
= 0 ? '#eb4e4e' : '#666666' }">
{{
Number
(
Number
(
scope
.
scope
.
lineationPrice
-
scope
.
scope
.
costPrice
).
toFixed
(
1
))
}}
</span>
</div>
</div>
...
@@ -24,6 +24,10 @@ export default {
...
@@ -24,6 +24,10 @@ export default {
selectedList
:
{
selectedList
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
},
goodsId
:{
type
:
String
,
default
:
''
}
}
},
},
data
()
{
data
()
{
...
@@ -51,10 +55,10 @@ export default {
...
@@ -51,10 +55,10 @@ export default {
isClear
:
true
isClear
:
true
}
}
],
],
getListApi
:
this
.
$apis
.
common
.
getMerchantList
,
getListApi
:
this
.
$apis
.
goods
.
getMerchantListApi
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'currentPage'
,
totalCount
:
'total'
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'currentPage'
,
totalCount
:
'total'
},
tableParams
:
{
tableParams
:
{
listName
:
'
l
ist'
,
listName
:
'
merchantL
ist'
,
mutiSelectName
:
'goodsIndex'
,
mutiSelectName
:
'goodsIndex'
,
mutiSelectUniqueKey
:
'id'
,
mutiSelectUniqueKey
:
'id'
,
tableOption
:
false
,
tableOption
:
false
,
...
@@ -65,7 +69,7 @@ export default {
...
@@ -65,7 +69,7 @@ export default {
},
},
{
{
label
:
'商户id'
,
label
:
'商户id'
,
prop
:
'merchant
No
'
prop
:
'merchant
Id
'
},
},
]
]
}
}
...
@@ -86,6 +90,14 @@ export default {
...
@@ -86,6 +90,14 @@ export default {
}
}
this
.
handleOk
()
this
.
handleOk
()
},
},
beforeSearchFn
(){
return
new
Promise
(
resolve
=>
{
this
.
dialogSearchForm
=
{
id
:
this
.
goodsId
}
resolve
()
})
},
onOk
()
{
onOk
()
{
let
list
=
this
.
$refs
.
tableRef
.
mutiSelectArr
[
this
.
tableParams
.
mutiSelectName
]
||
[]
let
list
=
this
.
$refs
.
tableRef
.
mutiSelectArr
[
this
.
tableParams
.
mutiSelectName
]
||
[]
// for (let i = 0; i < this.selectedList.length; i++) {
// for (let i = 0; i < this.selectedList.length; i++) {
...
...
src/views/goods/index.vue
View file @
06a1f75
...
@@ -153,7 +153,7 @@
...
@@ -153,7 +153,7 @@
{
{
label
:
'商品分类'
,
label
:
'商品分类'
,
name
:
'channelName'
,
name
:
'channelName'
,
type
:
'
selec
t'
type
:
'
inpu
t'
},
},
],
],
getListApi
:
this
.
$apis
.
goods
.
getGoodsListApi
,
getListApi
:
this
.
$apis
.
goods
.
getGoodsListApi
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment