Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
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 1f591d42
authored
Mar 19, 2024
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug修复
1 parent
520e048b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
221 additions
and
119 deletions
src/api/contentManager.js
src/common/util.js
src/views/contentManager/components/brandDialog/index.vue
src/views/contentManager/contentAdd.vue
src/views/contentManager/contentManagerList.vue
src/views/contentManager/statisticsList.vue
src/api/contentManager.js
View file @
1f591d4
...
@@ -62,6 +62,6 @@ export function getMerchantListByScene(data) {
...
@@ -62,6 +62,6 @@ export function getMerchantListByScene(data) {
//获取品牌列表
//获取品牌列表
export
function
getBrandList
(
data
)
{
export
function
getBrandList
(
data
)
{
data
.
method
=
`dj.api.smartcarlife.common.car.brand.
list
`
data
.
method
=
`dj.api.smartcarlife.common.car.brand.
page
`
return
request
(
data
)
return
request
(
data
)
}
}
src/common/util.js
View file @
1f591d4
...
@@ -262,7 +262,11 @@ export const Util = {
...
@@ -262,7 +262,11 @@ export const Util = {
// return
// return
const
Temp
=
document
.
createElement
(
"a"
)
const
Temp
=
document
.
createElement
(
"a"
)
// Temp.href = process.env.VUE_APP_BASE_URL + '/article/export.do?articleId=' + row.id
// Temp.href = process.env.VUE_APP_BASE_URL + '/article/export.do?articleId=' + row.id
url
=
url
+
`
${
url
.
includes
(
'?'
)
?
'&'
:
'?'
}
`
+
"timestamp="
+
new
Date
().
getTime
()
url
=
url
+
`
${
url
.
includes
(
"?"
)
?
"&"
:
"?"
}
`
+
"timestamp="
+
new
Date
().
getTime
()
Temp
.
href
=
url
Temp
.
href
=
url
// console.log(url)
// console.log(url)
// console.log(Temp.href)
// console.log(Temp.href)
...
@@ -339,6 +343,34 @@ export const Util = {
...
@@ -339,6 +343,34 @@ export const Util = {
num
+=
".00"
num
+=
".00"
}
}
return
num
return
num
},
getExplorer
:
function
()
{
var
ua
=
navigator
.
userAgent
.
toLocaleLowerCase
()
var
browserType
=
null
if
(
ua
.
match
(
/msie/
)
!=
null
||
ua
.
match
(
/trident/
)
!=
null
)
{
browserType
=
"IE"
}
else
if
(
ua
.
match
(
/firefox/
)
!=
null
)
{
browserType
=
"火狐"
}
else
if
(
ua
.
match
(
/ubrowser/
)
!=
null
)
{
browserType
=
"UC"
}
else
if
(
ua
.
match
(
/opera/
)
!=
null
)
{
browserType
=
"欧朋"
}
else
if
(
ua
.
match
(
/bidubrowser/
)
!=
null
)
{
browserType
=
"百度"
}
else
if
(
ua
.
match
(
/metasr/
)
!=
null
)
{
browserType
=
"搜狗"
}
else
if
(
ua
.
match
(
/tencenttraveler/
)
!=
null
||
ua
.
match
(
/qqbrowse/
)
!=
null
)
{
browserType
=
"QQ"
}
else
if
(
ua
.
match
(
/maxthon/
)
!=
null
)
{
browserType
=
"遨游"
}
else
{
browserType
=
"谷歌"
}
return
browserType
}
}
}
}
...
@@ -349,3 +381,4 @@ export const hideLoading = Util.closeLoading
...
@@ -349,3 +381,4 @@ export const hideLoading = Util.closeLoading
export
const
deepClone
=
Util
.
deepClone
export
const
deepClone
=
Util
.
deepClone
export
const
downLoadFile
=
Util
.
downLoadFile
export
const
downLoadFile
=
Util
.
downLoadFile
export
const
returnFloat
=
Util
.
returnFloat
export
const
returnFloat
=
Util
.
returnFloat
export
const
getExplorer
=
Util
.
getExplorer
src/views/contentManager/components/brandDialog/index.vue
View file @
1f591d4
<!-- 关联门店弹窗 -->
<
template
>
<
template
>
<d2-dialog
<d2-dialog
:isVisible=
"dialogVisible"
class=
"accountDailog"
title=
"选择品牌"
title=
"选择品牌"
width=
"720px"
:is-visible
.
sync=
"relateStoreVisible"
@
confirmDialog=
"handleAddConfirm"
width=
"70%"
@
closeDialog=
"handleClose"
btn-ok-label=
"确定"
@
confirmDialog=
"handleRelateStoreConfirm"
@
closeDialog=
"handleRelateStoreClose"
class=
"relateStore"
>
>
<
div
class=
"tableBox
"
>
<
el-form
:model=
"storeSearchForm"
ref=
"relate"
:inline=
"true
"
>
<
!--
<div
style=
"padding: 10px 50px
"
>
<
el-form-item
label=
"门店名称:
"
>
<el-input
<el-input
v-model
=
"real
SearchForm.label"
v-model
.
trim=
"store
SearchForm.label"
placeholder=
"
搜索品牌
名称"
placeholder=
"
门店
名称"
maxlength=
"20
"
@
keydown
.
native=
"handleStoreInput
"
clearable
clearable
size=
"small"
style=
"width: 300px; margin-right: 12px"
/>
/>
<el-button
size=
"small"
type=
"primary"
@
click=
"searchList"
>
</el-form-item>
查询
<el-button
type=
"primary"
@
click=
"handleSearchStore"
>
搜索
</el-button>
</el-button>
</el-form>
</div>
-->
<el-row
class=
"tableCon"
>
<d2-table
<div
class=
"tableBox"
>
class=
"table"
<el-table
ref=
"brandTable"
ref=
"seletingTable"
:table-params=
"tableParams"
:data=
"selectingData"
:tableData=
"tableData"
height=
"464px"
:hasPage=
"false"
class=
"table"
border
@
select=
"handleChange"
@
select-all=
"handleAll"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
prop=
"label"
label=
"品牌名称"
align=
"center"
>
</el-table-column>
</el-table>
<el-pagination
small
background
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"currentPage"
:page-size=
"pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
/>
</div>
<el-table
class=
"tableBox table"
:data=
"selectedData"
border
height=
"464px"
>
>
</d2-table>
<el-table-column
prop=
"merchantName"
label=
"品牌名称"
align=
"center"
>
</div>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
label
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"删除"
align=
"center"
width=
"50px"
>
<
template
slot-scope=
"scope"
>
<el-button
class=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
type=
"text"
/>
</
template
>
</el-table-column>
</el-table>
</el-row>
</d2-dialog>
</d2-dialog>
</template>
</template>
<
script
>
<
script
>
import
{
import
{
getBrandList
}
from
"@api/contentManager"
getAllMerchantList
,
getMerchantListByScene
,
getBrandList
}
from
"@api/contentManager"
import
{
deepClone
}
from
"@/common/util"
export
default
{
export
default
{
name
:
"SelectGoodsTypeDialog"
,
name
:
"RelateStoreDialog"
,
data
()
{
return
{
selectedData
:
[],
selectingData
:
[],
// 分页
total
:
0
,
currentPage
:
1
,
pageSize
:
20
,
storeSearchForm
:
{}
}
},
props
:
{
props
:
{
dialog
Visible
:
{
relateStore
Visible
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
},
},
s
electedRecor
d
:
{
s
toreSelecte
d
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
}
}
},
},
data
()
{
return
{
realSearchForm
:
{
label
:
""
},
tableData
:
[],
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
"list"
,
mutiSelectUniqueKey
:
"id"
,
mutiSelectName
:
"brandIndex"
,
tableColumns
:
[
{
label
:
"品牌名称"
,
prop
:
"label"
}
]
}
}
},
mounted
()
{
mounted
()
{
this
.
getList
()
this
.
selectedData
=
this
.
storeSelected
this
.
getSelectingList
()
},
},
methods
:
{
methods
:
{
getList
()
{
recoverySelection
()
{
getBrandList
({
label
:
"奥迪"
}).
then
((
res
)
=>
{
var
exitIds
=
this
.
selectedData
.
map
((
item
)
=>
item
.
id
)
console
.
log
(
res
)
this
.
selectingData
.
forEach
((
item
)
=>
{
if
(
res
?.
length
)
{
exitIds
.
includes
(
item
.
id
)
&&
this
.
sourceData
=
res
this
.
$refs
.
seletingTable
.
toggleRowSelection
(
item
,
true
)
this
.
tableData
=
res
}
})
})
},
},
searchList
()
{
getSelectingList
()
{
if
(
this
.
realSearchForm
.
label
)
{
getBrandList
({
this
.
tableData
=
this
.
sourceData
.
filter
((
item
)
=>
{
...
this
.
storeSearchForm
,
return
item
.
label
?.
indexOf
(
this
.
realSearchForm
.
label
)
>
-
1
currentPage
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
}).
then
((
res
)
=>
{
this
.
selectingData
=
res
.
list
this
.
total
=
res
.
total
this
.
$nextTick
(()
=>
{
this
.
recoverySelection
()
})
})
}
else
{
})
this
.
tableData
=
deepClone
(
this
.
sourceData
)
},
}
handleChange
(
selection
,
row
)
{
var
addOrDelete
=
!!
selection
.
find
((
item
)
=>
item
.
id
===
row
.
id
)
addOrDelete
?
this
.
selectedData
.
push
(
row
)
:
(
this
.
selectedData
=
this
.
selectedData
.
filter
(
(
item
)
=>
item
.
id
!==
row
.
id
))
},
handleAll
(
selection
)
{
this
.
selectingData
.
forEach
((
item
)
=>
{
var
isExit
=
this
.
selectedData
.
findIndex
(
(
subItem
)
=>
subItem
.
id
===
item
.
id
)
if
(
selection
.
length
&&
isExit
===
-
1
)
{
this
.
selectedData
.
push
(
item
)
}
else
if
(
!
selection
.
length
&&
isExit
!==
-
1
)
{
this
.
selectedData
.
splice
(
isExit
,
1
)
}
})
},
handleDelete
(
row
)
{
this
.
selectedData
=
this
.
selectedData
.
filter
((
item
)
=>
item
.
id
!==
row
.
id
)
const
obj
=
this
.
selectingData
.
find
((
v
)
=>
v
.
id
==
row
.
id
)
this
.
$refs
.
seletingTable
.
toggleRowSelection
(
obj
)
},
},
changeEvent
(
e
)
{
handleCurrentChange
(
val
)
{
console
.
log
(
e
)
this
.
currentPage
=
val
this
.
getSelectingList
()
},
},
handleAddConfirm
()
{
handleRelateStoreConfirm
()
{
const
selectItemList
=
this
.
$emit
(
"handleRelateStoreConfirm"
,
this
.
selectedData
)
this
.
$refs
.
brandTable
?.
mutiSelectArr
?.[
this
.
tableParams
.
mutiSelectName
]
||
[]
if
(
selectItemList
.
length
)
{
this
.
$emit
(
"confirmDialogFn"
,
selectItemList
)
}
else
{
this
.
$message
.
error
(
"请勾选品牌"
)
}
},
},
handleClose
()
{
handle
RelateStore
Close
()
{
this
.
$emit
(
"
closeDialogFn
"
)
this
.
$emit
(
"
handleRelateStoreClose
"
)
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.relateStore
.table
{
.table
{
margin
:
0
auto
20px
!important
;
::v-deep
.el-table__body-wrapper
{
width
:
98%
;
height
:
400px
;
}
overflow-y
:
auto
;
.relateStore
.tableCon
{
margin-top
:
20px
;
display
:
flex
;
.tableBox
{
flex
:
1
;
}
}
}
}
.service-store
.relateStore
.el-table
.cell
,
.d2-form
.relateStore
.el-table
.cell
{
line-height
:
26px
!important
;
}
.service-store
.relateStore
.el-table--medium
td
,
.d2-form
.relateStore
.el-table--medium
td
{
padding
:
6px
8px
!important
;
}
.relateStore
.red
{
color
:
red
;
}
.relateStore
.tip-icon
{
position
:
absolute
;
display
:
inline-block
;
height
:
10px
;
width
:
10px
;
line-height
:
10px
;
color
:
#ffffff
;
background-color
:
red
;
border
:
1px
solid
red
;
border-radius
:
50%
;
cursor
:
pointer
;
font-size
:
6px
;
margin-left
:
2px
;
}
</
style
>
</
style
>
src/views/contentManager/contentAdd.vue
View file @
1f591d4
...
@@ -204,13 +204,6 @@
...
@@ -204,13 +204,6 @@
>
>
</div>
</div>
</div>
</div>
<!--
<merchantDialog
v-if=
"merchantVisible"
:dialogVisible=
"merchantVisible"
:config=
"
{ scene: formData.scene, type: formData.showMerchant }"
@confirmDialogFn="confirmDialogFn"
@closeDialogFn="closeDialogFn"
>
</merchantDialog>
-->
<relate-store-dialog
<relate-store-dialog
v-if=
"relateStoreVisible"
v-if=
"relateStoreVisible"
ref=
"formRelateStore"
ref=
"formRelateStore"
...
@@ -264,10 +257,13 @@
...
@@ -264,10 +257,13 @@
</relate-store-dialog>
</relate-store-dialog>
<brandDialog
<brandDialog
v-if=
"brandVisible"
v-if=
"brandVisible"
:dialogVisible=
"brandVisible"
ref=
"brandRef"
@
confirmDialogFn=
"confirmDialogFn"
:relate-store-visible=
"brandVisible"
@
closeDialogFn=
"closeDialogFn"
:store-selected=
"storeSelected"
></brandDialog>
@
handleRelateStoreConfirm=
"handleRelateStoreConfirm"
@
handleRelateStoreClose=
"handleRelateStoreClose"
>
</brandDialog>
<el-dialog
:visible
.
sync=
"lookImgVisible"
>
<el-dialog
:visible
.
sync=
"lookImgVisible"
>
<img
width=
"100%"
:src=
"dialogObj.url"
alt=
"图片"
/>
<img
width=
"100%"
:src=
"dialogObj.url"
alt=
"图片"
/>
</el-dialog>
</el-dialog>
...
@@ -520,7 +516,8 @@ export default {
...
@@ -520,7 +516,8 @@ export default {
},
},
commitFn
(
type
)
{
commitFn
(
type
)
{
const
params
=
this
.
getParams
(
type
)
const
params
=
this
.
getParams
(
type
)
addContent
(
params
).
then
((
res
)
=>
{
const
_api
=
params
.
id
?
updateContent
:
addContent
_api
(
params
).
then
((
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
this
.
$message
.
success
(
this
.
$message
.
success
(
`
${
!
type
?
"保存草稿"
:
params
.
id
?
"修改"
:
"新增"
}
成功`
`
${
!
type
?
"保存草稿"
:
params
.
id
?
"修改"
:
"新增"
}
成功`
...
@@ -546,14 +543,17 @@ export default {
...
@@ -546,14 +543,17 @@ export default {
},
},
handleRelateStoreConfirm
(
selectedData
)
{
handleRelateStoreConfirm
(
selectedData
)
{
if
(
!
selectedData
.
length
)
{
if
(
!
selectedData
.
length
)
{
return
this
.
$message
.
error
(
"请选择门店"
)
return
this
.
$message
.
error
(
`请选择
${
this
.
formData
.
showMerchant
==
1
?
"品牌"
:
"门店"
}
`
)
}
}
this
.
$refs
.
channelForm
.
clearValidate
(
"showMerchant"
)
this
.
$refs
.
channelForm
.
clearValidate
(
"showMerchant"
)
this
.
tableData
=
selectedData
this
.
tableData
=
selectedData
this
.
relateStoreVisible
=
false
this
.
handleRelateStoreClose
()
},
},
handleRelateStoreClose
()
{
handleRelateStoreClose
()
{
this
.
relateStoreVisible
=
false
this
.
relateStoreVisible
=
false
this
.
brandVisible
=
false
},
},
handleStoreInput
(
e
)
{
handleStoreInput
(
e
)
{
e
.
keyCode
===
13
&&
this
.
handleSearchStore
()
e
.
keyCode
===
13
&&
this
.
handleSearchStore
()
...
@@ -561,17 +561,6 @@ export default {
...
@@ -561,17 +561,6 @@ export default {
handleSearchStore
()
{
handleSearchStore
()
{
this
.
$refs
.
formRelateStore
.
handleCurrentChange
(
1
)
this
.
$refs
.
formRelateStore
.
handleCurrentChange
(
1
)
},
},
confirmDialogFn
(
e
)
{
this
.
closeDialogFn
()
this
.
$refs
.
channelForm
.
clearValidate
(
"showMerchant"
)
this
.
$nextTick
(()
=>
{
this
.
tableData
=
e
||
[]
})
},
closeDialogFn
()
{
this
.
merchantVisible
=
false
this
.
brandVisible
=
false
},
delMerchant
(
row
,
idx
)
{
delMerchant
(
row
,
idx
)
{
this
.
tableData
.
splice
(
idx
,
1
)
this
.
tableData
.
splice
(
idx
,
1
)
}
}
...
...
src/views/contentManager/contentManagerList.vue
View file @
1f591d4
...
@@ -280,7 +280,7 @@ export default {
...
@@ -280,7 +280,7 @@ export default {
var
params
=
{
currentPage
:
1
,
pageSize
:
2000
,
merchantIdName
:
""
}
var
params
=
{
currentPage
:
1
,
pageSize
:
2000
,
merchantIdName
:
""
}
this
.
getBaseData
()
this
.
getBaseData
()
getMerchantList
(
params
).
then
((
res
)
=>
{
getMerchantList
(
params
).
then
((
res
)
=>
{
this
.
getSetMerchant
(
res
.
list
||
[])
this
.
getSetMerchant
(
res
||
[])
})
})
},
},
...
...
src/views/contentManager/statisticsList.vue
View file @
1f591d4
...
@@ -34,7 +34,11 @@
...
@@ -34,7 +34,11 @@
<
script
>
<
script
>
import
{
Util
,
deepClone
}
from
"@/common/util"
import
{
Util
,
deepClone
}
from
"@/common/util"
import
{
getStatisticsList
,
exportStatisticsList
,
getMerchantList
}
from
"@api/contentManager"
import
{
getStatisticsList
,
exportStatisticsList
,
getMerchantList
}
from
"@api/contentManager"
export
default
{
export
default
{
name
:
"contentManagerList"
,
name
:
"contentManagerList"
,
data
()
{
data
()
{
...
@@ -105,7 +109,7 @@ export default {
...
@@ -105,7 +109,7 @@ export default {
var
params
=
{
currentPage
:
1
,
pageSize
:
2000
,
merchantIdName
:
""
}
var
params
=
{
currentPage
:
1
,
pageSize
:
2000
,
merchantIdName
:
""
}
getMerchantList
(
params
)
getMerchantList
(
params
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
this
.
getBaseData
(
res
.
list
)
this
.
getBaseData
(
res
)
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
getBaseData
([])
this
.
getBaseData
([])
...
@@ -150,7 +154,7 @@ export default {
...
@@ -150,7 +154,7 @@ export default {
exportStatisticsList
(
params
).
then
((
res
)
=>
{
exportStatisticsList
(
params
).
then
((
res
)
=>
{
console
.
log
(
res
,
"res"
)
console
.
log
(
res
,
"res"
)
// window.open(res)
// window.open(res)
let
tempaa
=
utils
.
getExplorer
()
let
tempaa
=
Util
.
getExplorer
()
if
(
tempaa
==
"QQ"
)
{
if
(
tempaa
==
"QQ"
)
{
window
.
open
(
res
)
window
.
open
(
res
)
}
else
{
}
else
{
...
...
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