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 56c36e4e
authored
Dec 12, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交
1 parent
0362e858
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
22 deletions
src/api/modules/goods.js
src/views/goods/addPrefer.vue
src/views/goods/components/selectGoods.vue
src/views/goods/components/selectMerchantDialog.vue
src/api/modules/goods.js
View file @
56c36e4
...
...
@@ -162,6 +162,16 @@ const getOilCouponListApi = params => {
data
:
params
})
}
const
getAllMerchantListApi
=
params
=>
{
params
.
method
=
'scrm.api.carlife.merchant.listWithPageByCurMerchant'
return
http
({
url
:
'rop-scrm-carlife/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getGoodsListApi
,
updateGoodsStatusApi
,
...
...
@@ -177,5 +187,6 @@ export default {
exportBrowseApi
,
exportGoodsApi
,
getSelfGoodsDetailApi
,
getOilCouponListApi
getOilCouponListApi
,
getAllMerchantListApi
}
\ No newline at end of file
src/views/goods/addPrefer.vue
View file @
56c36e4
...
...
@@ -948,8 +948,8 @@ export default {
this
.
goodsVisible
=
false
},
handleGoodsConfirm
(
e
)
{
cons
ole
.
log
(
e
)
if
(
this
.
formObj
.
smartcarlifeInfoId
!=
e
?.
id
)
this
.
saleMerchantList
=
[]
cons
t
{
goodsSource
}
=
this
.
formObj
if
(
this
.
formObj
.
smartcarlifeInfoId
!=
e
?.
id
&&
goodsSource
!=
3
)
this
.
saleMerchantList
=
[]
let
{
id
,
goodsName
,
goodsImage
,
minSellPrice
,
retailPrice
,
goodsVideo
,
goodsId
}
=
e
||
{}
minSellPrice
=
minSellPrice
?
Number
(
Number
(
minSellPrice
/
100
).
toFixed
(
2
))
:
0
retailPrice
=
retailPrice
?
Number
(
Number
(
retailPrice
/
100
).
toFixed
(
2
))
:
0
...
...
@@ -1019,7 +1019,8 @@ export default {
this
.
closeDialog
()
},
closeDialog
()
{
if
(
!
this
.
merchantDialogVisible
&&
!
this
.
formObj
.
smartcarlifeInfoId
)
{
const
{
goodsSource
}
=
this
.
formObj
if
(
goodsSource
!=
3
&&
!
this
.
merchantDialogVisible
&&
!
this
.
formObj
.
smartcarlifeInfoId
)
{
return
this
.
$message
.
error
(
'请先选择商品'
)
}
this
.
merchantDialogVisible
=
!
this
.
merchantDialogVisible
...
...
@@ -1040,6 +1041,7 @@ export default {
delete
obj
.
styleBImgList
let
saleMerchantList
=
this
.
saleMerchantList
.
map
(
item
=>
{
let
{
merchantId
,
merchantName
,
activityPrice
,
giveIntegral
,
originalPrice
,
exchangeIntegralFlag
,
exchangeIntegral
}
=
item
if
(
obj
.
goodsSource
==
3
)
merchantId
=
item
.
merchantNo
activityPrice
=
activityPrice
?
Number
(
Number
(
activityPrice
*
10
*
10
).
toFixed
(
0
))
:
0
originalPrice
=
originalPrice
?
Number
(
Number
(
originalPrice
*
10
*
10
).
toFixed
(
0
))
:
0
let
saleMerchantItem
=
{
merchantId
,
merchantName
,
activityPrice
,
giveIntegral
,
originalPrice
}
...
...
src/views/goods/components/selectGoods.vue
View file @
56c36e4
...
...
@@ -342,6 +342,7 @@ export default {
},
handleConfirm
()
{
if
(
Object
.
keys
(
this
.
curInfo
).
length
)
this
.
$emit
(
'handleGoodsConfirm'
,
this
.
curInfo
)
else
this
.
$message
.
error
(
'请选择商品'
)
}
}
}
...
...
src/views/goods/components/selectMerchantDialog.vue
View file @
56c36e4
<
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"
>
<!--
<GLCombiForm
:rowNumber=
"1"
class=
"dialog_search"
ref=
"searchRef"
:formObj=
"dialogSearchForm"
:formData=
"dialogFormData"
@
handleOk=
"handleOk"
@
handleRest=
"handleRest"
></GLCombiForm>
-->
<div
class=
"dialog_table"
>
<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"
>
<GLTable
v-if=
"showTable"
:hasPage=
"isOil"
:pageSizes=
"pageSizes"
ref=
"tableRef"
:beforeSearchFn=
"beforeSearchFn"
:pageConf=
"pageConf"
@
setTableFinishFun=
"setTableFinishFun"
:searchForm=
"dialogSearchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
>
<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>
</div>
</GLTable>
...
...
@@ -23,14 +46,14 @@ export default {
},
selectedList
:
{
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
},
goodsId
:{
goodsId
:
{
type
:
String
,
default
:
''
}
},
data
()
{
data
()
{
return
{
showTable
:
true
,
copyList
:
[],
...
...
@@ -55,7 +78,7 @@ export default {
isClear
:
true
}
],
getListApi
:
this
.
$apis
.
goods
.
getMerchantListApi
,
getListApi
:
null
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'currentPage'
,
totalCount
:
'total'
},
tableParams
:
{
listName
:
'merchantList'
,
...
...
@@ -72,24 +95,29 @@ export default {
prop
:
'merchantId'
},
]
}
},
isOil
:
this
.
$parent
.
formObj
.
goodsSource
==
3
}
},
created
()
{
created
()
{
const
{
isOil
}
=
this
this
.
copyList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
selectedList
))
this
.
getListApi
=
this
.
$apis
.
goods
[
isOil
?
'getAllMerchantListApi'
:
'getMerchantListApi'
]
this
.
tableParams
.
listName
=
isOil
?
'list'
:
'merchantList'
this
.
tableParams
.
tableColumns
[
1
].
prop
=
isOil
?
'merchantNo'
:
'merchantId'
},
methods
:
{
handleOk
()
{
handleOk
()
{
this
.
$refs
.
tableRef
.
refreshTable
()
},
handleRest
()
{
handleRest
()
{
this
.
dialogSearchForm
=
{
merchantName
:
''
,
merchantId
:
''
}
this
.
handleOk
()
},
beforeSearchFn
()
{
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
this
.
dialogSearchForm
=
{
id
:
this
.
goodsId
...
...
@@ -97,7 +125,7 @@ export default {
resolve
()
})
},
onOk
()
{
onOk
()
{
let
list
=
this
.
$refs
.
tableRef
.
mutiSelectArr
[
this
.
tableParams
.
mutiSelectName
]
||
[]
// for (let i = 0; i < this.selectedList.length; i++) {
// let idx = list.findIndex(item => item.id == this.selectedList[i].id)
...
...
@@ -107,19 +135,20 @@ export default {
// }
list
.
map
(
item
=>
this
.
$set
(
item
,
'activityPrice'
,
''
))
list
.
map
(
item
=>
this
.
$set
(
item
,
'originalPrice'
,
''
))
this
.
$emit
(
'confirmDialog'
,
[...
list
,
...
this
.
copyList
])
this
.
$emit
(
'confirmDialog'
,
[...
list
,
...
this
.
copyList
])
},
handleClose
()
{
handleClose
()
{
this
.
$emit
(
'closeDialog'
)
},
setTableFinishFun
()
{
setTableFinishFun
()
{
const
KEY
=
this
.
isOil
?
'merchantNo'
:
'merchantId'
this
.
copyList
.
forEach
(
row
=>
{
this
.
$nextTick
(()
=>
{
let
idx
=
this
.
$refs
.
tableRef
.
$refs
[
this
.
tableParams
.
mutiSelectName
+
'MutiTable'
].
data
.
findIndex
(
item
=>
item
.
merchantId
==
row
.
merchantId
)
let
idx
=
this
.
$refs
.
tableRef
.
$refs
[
this
.
tableParams
.
mutiSelectName
+
'MutiTable'
].
data
.
findIndex
(
item
=>
item
[
KEY
]
==
row
[
KEY
]
)
if
(
idx
>
-
1
)
{
try
{
this
.
$refs
.
tableRef
.
$refs
[
this
.
tableParams
.
mutiSelectName
+
'MutiTable'
].
toggleRowSelection
(
this
.
$refs
.
tableRef
.
$refs
[
this
.
tableParams
.
mutiSelectName
+
'MutiTable'
].
data
[
idx
],
true
)
let
id
=
this
.
copyList
.
findIndex
(
item
=>
item
.
merchantId
==
row
.
merchantId
)
let
id
=
this
.
copyList
.
findIndex
(
item
=>
item
[
KEY
]
==
row
[
KEY
]
)
if
(
id
>
-
1
)
this
.
copyList
.
splice
(
id
,
1
)
}
catch
(
err
)
{
console
.
log
(
err
)
...
...
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