Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
glsx-staging
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a4572bba
authored
Apr 09, 2020
by
liwk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
e9468160
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
24 deletions
src/api/storeManagement.js
src/plugin/axios/index.js
src/store/modules/d2admin/modules/account.js
src/views/storeManagement/index.vue
src/views/system/login/index.vue
src/api/storeManagement.js
View file @
a4572bb
...
@@ -17,9 +17,9 @@ function delStore(data) {
...
@@ -17,9 +17,9 @@ function delStore(data) {
return
request
(
data
,
RequestMethods
.
POST
)
return
request
(
data
,
RequestMethods
.
POST
)
}
}
function
getQr
(
data
)
{
function
getQr
(
data
,
type
)
{
data
.
method
=
`
${
path
}
qrcode`
data
.
method
=
`
${
path
}
qrcode`
return
request
(
data
,
RequestMethods
.
GET
,
'arraybuffer'
)
return
request
(
data
,
RequestMethods
.
GET
,
type
)
}
}
function
downLoadDome
(
data
)
{
function
downLoadDome
(
data
)
{
...
...
src/plugin/axios/index.js
View file @
a4572bb
...
@@ -98,7 +98,11 @@ service.interceptors.response.use(
...
@@ -98,7 +98,11 @@ service.interceptors.response.use(
// refreshTable = false
// refreshTable = false
// }
// }
return
data
||
'success'
||
msg
return
data
||
'success'
||
msg
case
205
:
router
.
replace
(
'/login'
)
break
default
:
default
:
// 不是正确的 code
// 不是正确的 code
errorCreate
(
`
${
dataAxios
.
msg
}
`
)
errorCreate
(
`
${
dataAxios
.
msg
}
`
)
break
break
...
...
src/store/modules/d2admin/modules/account.js
View file @
a4572bb
...
@@ -31,7 +31,6 @@ export default {
...
@@ -31,7 +31,6 @@ export default {
'authId'
:
'104'
,
'authId'
:
'104'
,
'parentId'
:
'0'
'parentId'
:
'0'
}]
}]
console
.
log
(
data
)
await
dispatch
(
'd2admin/auth/set'
,
authes
,
{
root
:
true
})
await
dispatch
(
'd2admin/auth/set'
,
authes
,
{
root
:
true
})
delete
data
.
authes
delete
data
.
authes
await
dispatch
(
'd2admin/user/set'
,
{
await
dispatch
(
'd2admin/user/set'
,
{
...
...
src/views/storeManagement/index.vue
View file @
a4572bb
...
@@ -67,7 +67,8 @@
...
@@ -67,7 +67,8 @@
>
>
<span
<span
slot=
"auth-button"
slot=
"auth-button"
slot-scope=
"scope"
>
slot-scope=
"scope"
>
<el-button
<el-button
type=
"text"
type=
"text"
@
click=
"handleTip(scope.scope)"
@
click=
"handleTip(scope.scope)"
...
@@ -77,12 +78,21 @@
...
@@ -77,12 +78,21 @@
@
click=
"handleEdit(scope.scope)"
@
click=
"handleEdit(scope.scope)"
>
编辑
</el-button>
>
编辑
</el-button>
<el-button
<el-button
:disabled=
"!
!scope.scope.merId"
:disabled=
"
!scope.scope.merId"
type=
"text"
type=
"text"
@
click=
"handleEdit
(scope.scope)"
@
click=
"showQr
(scope.scope)"
>
查看二维码
</el-button>
>
查看二维码
</el-button>
<el-tooltip
class=
"item"
effect=
"dark"
:content=
"tipsContent"
placement=
"left"
>
<el-tooltip
<i
v-if=
"!!scope.scope.merId"
style=
"margin-left: 4px;"
class=
"el-icon-warning-outline"
></i>
class=
"item"
effect=
"dark"
:content=
"tipsContent"
placement=
"left"
>
<i
v-if=
"!scope.scope.merId"
style=
"margin-left: 4px;"
class=
"el-icon-warning-outline"
></i>
</el-tooltip>
</el-tooltip>
</span>
</span>
<!--
<auth-button
<!--
<auth-button
...
@@ -184,16 +194,6 @@
...
@@ -184,16 +194,6 @@
></el-input>
></el-input>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<el-tooltip
content=
"请如实填写门店信息并保存之后,才能下载二维码"
placement=
"top"
>
<el-link
type=
"primary"
@
click=
'downLoadQr'
:underline=
'false'
>
下载二维码
<i
class=
"el-icon-warning-outline el-icon--right"
></i>
</el-link>
</el-tooltip>
<span
<span
slot=
"footer"
slot=
"footer"
class=
"dialog-footer"
class=
"dialog-footer"
...
@@ -372,6 +372,31 @@
...
@@ -372,6 +372,31 @@
<el-button
@
click=
"tipVisible = false"
>
取 消
</el-button>
<el-button
@
click=
"tipVisible = false"
>
取 消
</el-button>
</span>
</span>
</el-dialog>
</el-dialog>
<el-dialog
title=
"门店二维码"
:visible
.
sync=
"storeQr"
width=
"375px"
:before-close=
"showQr"
>
<el-image
style=
"width: 100%; height: 667px"
:src=
"qrSrc"
v-loading=
"qrLoading"
></el-image>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
''
size=
"small"
type=
"primary"
@
click=
"downLoadQr"
>
下载
</el-button>
<el-button
@
click=
"storeQr = false"
>
关闭
</el-button>
</span>
</el-dialog>
</d2-container>
</d2-container>
</
template
>
</
template
>
...
@@ -382,6 +407,7 @@ export default {
...
@@ -382,6 +407,7 @@ export default {
name
:
'storeManagement'
,
name
:
'storeManagement'
,
data
()
{
data
()
{
return
{
return
{
qrLoading
:
false
,
searchForm
:
{},
searchForm
:
{},
tableParams
:
{
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
...
@@ -451,7 +477,9 @@ export default {
...
@@ -451,7 +477,9 @@ export default {
merIdFailFile
:
''
,
merIdFailFile
:
''
,
tipVisible
:
false
,
tipVisible
:
false
,
rowData
:
{},
rowData
:
{},
tipsContent
:
'资料不完整,无法查看'
tipsContent
:
'资料不完整,无法查看'
,
storeQr
:
false
,
qrSrc
:
''
}
}
},
},
methods
:
{
methods
:
{
...
@@ -506,14 +534,13 @@ export default {
...
@@ -506,14 +534,13 @@ export default {
let
blob
=
new
Blob
([
res
],
{
type
:
"application/vnd.ms-excel"
})
let
blob
=
new
Blob
([
res
],
{
type
:
"application/vnd.ms-excel"
})
let
objectUrl
=
URL
.
createObjectURL
(
blob
)
let
objectUrl
=
URL
.
createObjectURL
(
blob
)
a
.
setAttribute
(
"href"
,
objectUrl
)
a
.
setAttribute
(
"href"
,
objectUrl
)
a
.
setAttribute
(
"download"
,
'门店信息.xls'
)
a
.
setAttribute
(
"download"
,
'门店信息.xls
x
'
)
a
.
click
()
a
.
click
()
})
})
},
},
downLoadQr
()
{
downLoadQr
()
{
if
(
!
this
.
downLoadFlag
)
return
let
id
=
this
.
storeForm
.
id
let
id
=
this
.
storeForm
.
id
api
.
getQr
({
shopId
:
id
}).
then
(
res
=>
{
api
.
getQr
({
shopId
:
id
}
,
'arraybuffer'
).
then
(
res
=>
{
let
a
=
document
.
createElement
(
'a'
)
let
a
=
document
.
createElement
(
'a'
)
let
blob
=
new
Blob
([
res
],
{
type
:
"image/png"
})
let
blob
=
new
Blob
([
res
],
{
type
:
"image/png"
})
let
objectUrl
=
URL
.
createObjectURL
(
blob
)
let
objectUrl
=
URL
.
createObjectURL
(
blob
)
...
@@ -521,7 +548,6 @@ export default {
...
@@ -521,7 +548,6 @@ export default {
a
.
setAttribute
(
"download"
,
`
${
this
.
storeForm
.
name
}
.png`
)
a
.
setAttribute
(
"download"
,
`
${
this
.
storeForm
.
name
}
.png`
)
a
.
click
()
a
.
click
()
})
})
},
},
handleImportExcel
()
{
handleImportExcel
()
{
if
(
this
.
importExcelVisible
)
{
if
(
this
.
importExcelVisible
)
{
...
@@ -629,8 +655,31 @@ export default {
...
@@ -629,8 +655,31 @@ export default {
a
.
setAttribute
(
"download"
,
'门店二维码.rar'
)
a
.
setAttribute
(
"download"
,
'门店二维码.rar'
)
a
.
click
()
a
.
click
()
})
})
},
showQr
(
row
)
{
this
.
storeQr
=
!
this
.
storeQr
if
(
!
this
.
storeQr
)
return
this
.
qrLoading
=
true
this
.
storeForm
.
id
=
row
.
id
this
.
storeForm
.
name
=
row
.
name
api
.
getQr
({
shopId
:
row
.
id
},
'blob'
).
then
(
res
=>
{
let
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
res
)
reader
.
onload
=
e
=>
{
this
.
qrSrc
=
e
.
target
.
result
this
.
qrLoading
=
false
}
})
}
}
},
},
watch
:
{
storeQr
(
val
)
{
if
(
!
val
)
{
this
.
qrLoading
=
true
this
.
qrSrc
=
''
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
...
...
src/views/system/login/index.vue
View file @
a4572bb
...
@@ -167,7 +167,6 @@ export default {
...
@@ -167,7 +167,6 @@ export default {
this
.
login
(
this
.
login
(
this
.
formLogin
this
.
formLogin
).
then
(
async
data
=>
{
).
then
(
async
data
=>
{
console
.
log
(
data
)
const
_current
=
await
this
.
current
()
const
_current
=
await
this
.
current
()
// this.$router.replace(this.$route.query.redirect || _current)
// this.$router.replace(this.$route.query.redirect || _current)
this
.
$router
.
replace
(
this
.
$route
.
query
.
redirect
||
_current
)
this
.
$router
.
replace
(
this
.
$route
.
query
.
redirect
||
_current
)
...
...
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