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 834f802f
authored
Apr 06, 2020
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
合并代码
2 parents
35a637f2
3a7b7f53
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
26 deletions
src/api/request.js
src/api/storeManagement.js
src/plugin/axios/index.js
src/views/storeManagement/index.vue
src/api/request.js
View file @
834f802
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
import
axios
from
'@/plugin/axios'
import
axios
from
'@/plugin/axios'
import
sign
from
'./sign'
import
sign
from
'./sign'
import
RequestMethods
from
'./request.methods'
import
RequestMethods
from
'./request.methods'
const
request
=
(
params
=
{},
method
=
RequestMethods
.
GET
)
=>
{
const
request
=
(
params
=
{},
method
=
RequestMethods
.
GET
,
responseType
)
=>
{
// params.source = 'glsx-staging'
// params.source = 'glsx-staging'
// params.app_key = '48e5e13229b82c1b4e6e8c96151f0637'
// params.app_key = '48e5e13229b82c1b4e6e8c96151f0637'
// params.timestamp = new Date().getTime()
// params.timestamp = new Date().getTime()
...
@@ -41,7 +41,8 @@ const request = (params = {}, method = RequestMethods.GET) => {
...
@@ -41,7 +41,8 @@ const request = (params = {}, method = RequestMethods.GET) => {
return
axios
({
return
axios
({
url
,
url
,
method
,
method
,
params
params
,
responseType
})
})
}
}
export
default
request
export
default
request
\ No newline at end of file
\ No newline at end of file
src/api/storeManagement.js
View file @
834f802
...
@@ -6,6 +6,11 @@ function storeList(data) {
...
@@ -6,6 +6,11 @@ function storeList(data) {
return
request
(
data
)
return
request
(
data
)
}
}
function
exportExcel
(
data
)
{
data
.
method
=
`
${
path
}
export`
return
request
(
data
,
'get'
,
'arraybuffer'
)
}
export
{
export
{
storeList
storeList
,
exportExcel
}
}
\ No newline at end of file
\ No newline at end of file
src/plugin/axios/index.js
View file @
834f802
...
@@ -86,23 +86,29 @@ service.interceptors.response.use(
...
@@ -86,23 +86,29 @@ service.interceptors.response.use(
store
.
commit
(
'd2admin/loading/set'
,
false
)
store
.
commit
(
'd2admin/loading/set'
,
false
)
// dataAxios 是 axios 返回数据中的 data
// dataAxios 是 axios 返回数据中的 data
const
dataAxios
=
response
.
data
const
dataAxios
=
response
.
data
// 这个状态码是和后端约定的
// 这个状态码是和后端约定的
const
{
code
,
data
}
=
dataAxios
const
{
code
,
data
}
=
dataAxios
// 有 code 代表这是一个后端接口 可以进行进一步的判断
// 有 code 代表这是一个后端接口 可以进行进一步的判断
switch
(
code
)
{
if
(
code
)
{
case
200
:
switch
(
code
)
{
// [ 示例 ] code === 0 代表没有错误
case
200
:
// if (refreshTable) {
// [ 示例 ] code === 0 代表没有错误
// store.commit('d2admin/refreshtable/set', !store.state.d2admin.refreshtable.value)
// if (refreshTable) {
// refreshTable = false
// store.commit('d2admin/refreshtable/set', !store.state.d2admin.refreshtable.value)
// }
// refreshTable = false
return
data
// }
default
:
return
data
// 不是正确的 code
default
:
errorCreate
(
`
${
dataAxios
.
message
}
`
)
// 不是正确的 code
break
errorCreate
(
`
${
dataAxios
.
message
}
`
)
break
}
}
else
{
if
(
response
.
status
==
200
)
{
return
dataAxios
}
}
}
// refreshTable = false
// refreshTable = false
},
},
...
...
src/views/storeManagement/index.vue
View file @
834f802
<
template
>
<
template
>
<d2-container>
<d2-container>
<el-form
:inline=
"true"
label-width=
"140px"
>
<el-form
:inline=
"true"
label-width=
"140px"
>
<el-form-item
label=
"门店名称:"
>
<el-form-item
label=
"门店名称:"
>
<el-input
v-model=
"searchForm.name"
placeholder=
"请输入"
clearable
></el-input>
<el-input
v-model=
"searchForm.name"
placeholder=
"请输入"
clearable
></el-input>
</el-form-item>
</el-form-item>
...
@@ -22,7 +25,7 @@
...
@@ -22,7 +25,7 @@
icon=
"el-icon-search"
icon=
"el-icon-search"
:id=
"tableParams.btnId"
:id=
"tableParams.btnId"
>
查询
</el-button>
>
查询
</el-button>
<el-button>
导出Excel
</el-button>
<el-button
@
click=
'handleExport'
>
导出Excel
</el-button>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
>
导入门店信息
</el-button>
<el-button
type=
"primary"
>
导入门店信息
</el-button>
...
@@ -34,7 +37,8 @@
...
@@ -34,7 +37,8 @@
ref=
"saleTaskTable"
ref=
"saleTaskTable"
:searchForm=
"searchForm"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:tableParams=
"tableParams"
:getListApi=
"queryListApi"
>
:getListApi=
"queryListApi"
>
<auth-button
<auth-button
slot=
"auth-button"
slot=
"auth-button"
slot-scope=
"scope"
slot-scope=
"scope"
...
@@ -72,8 +76,14 @@
...
@@ -72,8 +76,14 @@
<el-input
v-model=
"storeForm.merId"
placeholder=
"请输入"
clearable
></el-input>
<el-input
v-model=
"storeForm.merId"
placeholder=
"请输入"
clearable
></el-input>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<span
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
保存
</el-button>
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
保存
</el-button>
<el-button
@
click=
"storeVisible = false"
>
取消
</el-button>
<el-button
@
click=
"storeVisible = false"
>
取消
</el-button>
</span>
</span>
</el-dialog>
</el-dialog>
...
@@ -81,10 +91,11 @@
...
@@ -81,10 +91,11 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
storeList
}
from
'@api/storeManagement'
import
{
storeList
,
exportExcel
}
from
'@api/storeManagement'
import
axios
from
'axios'
export
default
{
export
default
{
name
:
'storeManagement'
,
name
:
'storeManagement'
,
data
()
{
data
()
{
return
{
return
{
searchForm
:
{},
searchForm
:
{},
tableParams
:
{
tableParams
:
{
...
@@ -141,10 +152,10 @@ export default {
...
@@ -141,10 +152,10 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
handleDelete
(
row
)
{
handleDelete
(
row
)
{
console
.
log
(
row
)
console
.
log
(
row
)
},
},
handleEdit
(
row
)
{
handleEdit
(
row
)
{
this
.
storeVisible
=
!
this
.
storeVisible
this
.
storeVisible
=
!
this
.
storeVisible
if
(
this
.
storeVisible
&&
this
.
$refs
.
storeRuleForm
)
this
.
$refs
.
storeRuleForm
.
resetFields
()
if
(
this
.
storeVisible
&&
this
.
$refs
.
storeRuleForm
)
this
.
$refs
.
storeRuleForm
.
resetFields
()
},
},
...
...
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