Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vanke
manage
Commits
b1794e37
Commit
b1794e37
authored
Aug 18, 2020
by
wangyalan-git
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
库房修改管理员
parent
4c012d27
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
215 additions
and
3 deletions
+215
-3
request.js
src/utils/request.js
+1
-1
DepotAdmin.vue
src/views/inv/DepotAdmin.vue
+2
-1
AdminList.vue
src/views/use/AdminList.vue
+12
-1
UpdateDepot.vue
src/views/use/modules/UpdateDepot.vue
+200
-0
No files found.
src/utils/request.js
View file @
b1794e37
...
...
@@ -6,7 +6,7 @@ import { getToken } from '@/utils/auth'
const
service
=
axios
.
create
({
// baseURL: process.env.BASE_API,
withCredentials
:
true
,
baseURL
:
'http://192.168.31.11
8
:8201/mall-admin'
,
baseURL
:
'http://192.168.31.11
2
:8201/mall-admin'
,
// baseURL: 'http://hhg.api.jsonpro.cn:8201/mall-admin',
timeout
:
60000
// 请求超时时间
})
...
...
src/views/inv/DepotAdmin.vue
View file @
b1794e37
...
...
@@ -20,7 +20,7 @@
</el-table-column>
<el-table-column
label=
"管理员"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
username
}}
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
adminName
||
'--'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
align=
"center"
>
...
...
@@ -128,6 +128,7 @@ export default {
//请求数据
console
.
log
(
'listQuery'
,
this
.
listQuery
)
getStockRooms
(
this
.
listQuery
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
this
.
listLoading
=
false
this
.
list
=
res
.
data
.
list
this
.
total
=
res
.
data
.
total
...
...
src/views/use/AdminList.vue
View file @
b1794e37
...
...
@@ -66,6 +66,10 @@
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"success"
@
click=
"handleUpdate(scope.row)"
>
修改库房
</el-button>
<el-button
size=
"mini"
type=
"danger"
@
click=
"handleDelete(scope.row)"
>
解绑
</el-button>
</
template
>
...
...
@@ -85,12 +89,15 @@
</el-pagination>
</div>
</el-card>
<update-depot
ref=
"updateDepot"
@
ok=
"getList"
></update-depot>
</div>
</template>
<
script
>
import
moment
from
'moment'
import
{
getMemberList
,
cancleAdmin
}
from
'@/api/user'
import
AddDepot
from
'./modules/AddAdmin'
import
UpdateDepot
from
'./modules/UpdateDepot'
// 列表查询参数默认值
const
defaultListQuery
=
{
pageNum
:
1
,
...
...
@@ -101,7 +108,7 @@ const defaultListQuery = {
export
default
{
name
:
'AdminList'
,
components
:
{
AddDepot
},
components
:
{
AddDepot
,
UpdateDepot
},
data
()
{
return
{
listQuery
:
Object
.
assign
({},
defaultListQuery
),
...
...
@@ -171,6 +178,10 @@ export default {
})
}).
catch
(()
=>
{
})
},
// 修改库房
handleUpdate
(
row
){
this
.
$refs
.
updateDepot
.
update
(
row
)
}
}
}
...
...
src/views/use/modules/UpdateDepot.vue
0 → 100644
View file @
b1794e37
<
template
>
<el-dialog
:visible
.
sync=
"visible"
:title=
"title"
center
width=
"720px"
>
<!-- start -->
<el-form
:model=
"model"
ref=
"myForm"
v-loading=
"loading"
label-width=
"200px"
>
<div
class=
"scroll-container"
ref=
"scrollContainer"
>
<!--
<el-form-item
label=
"域账号:"
--
>
<!-- prop="username"-->
<!-- :rules="[
{ required: true, message: '域账号不能为空', trigger: 'blur' }]">-->
<!--
<el-input
v-model=
"model.username"
--
>
<!-- :disabled="isEdit"-->
<!-- placeholder="请输入ad域账号"-->
<!-- class="input-width">
</el-input>
-->
<!--<!–
<div
class=
"tip"
>
可使用手机号作为用户名称
</div>
–>
-->
<!--
</el-form-item>
-->
<!--
<el-form-item
label=
"登录密码:"
--
>
<!-- prop="password"-->
<!-- :rules="[
{ required: true, message: '登录密码不能为空', trigger: 'blur' }]">-->
<!--
<el-input-->
<!-- :maxlength="6"-->
<!-- v-model="model.password"-->
<!-- type="password"-->
<!-- auto-complete="new-password"-->
<!-- class="input-width">
</el-input>
-->
<!--
</el-form-item>
-->
<el-form-item
label=
"库房:"
prop=
"stockRoomId"
:rules=
"[
{ required: true, trigger: 'change', message: '请选择库房' }]">
<el-select
size=
"small"
class=
"input-width"
v-model=
"model.stockRoomId"
>
<el-option
v-for=
"item in depotOptions"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
>
</el-option>
</el-select>
</el-form-item>
<!--
<el-form-item
label=
"角色分配:"
--
>
<!-- prop="roleId"-->
<!-- :rules="[
{ required: true, message: '角色不能为空', trigger: 'change' }]">-->
<!--
<el-select
v-model=
"model.roleId"
--
>
<!-- class="input-width">-->
<!--
<el-option
v-for=
"item in allRoleList"
--
>
<!-- :key="item.id"-->
<!-- :label="item.name"-->
<!-- :value="item.id">
</el-option>
-->
<!--
</el-select>
-->
<!--
</el-form-item>
-->
</div>
</el-form>
<div
slot=
"footer"
>
<el-button
type=
"primary"
@
click=
"submit"
>
确认
</el-button>
<el-button
@
click=
"close"
>
取消
</el-button>
</div>
<!-- end -->
</el-dialog>
</
template
>
<
script
>
import
{
updateMember
}
from
'@/api/user'
// import { fetchAllRoleList } from '@/api/role'
import
{
getStockRooms
}
from
'@/api/inventory'
// 添加编辑属性
export
default
{
name
:
'AddAdmin'
,
data
()
{
return
{
allRoleList
:
[],
depotOptions
:
[],
visible
:
false
,
title
:
null
,
loading
:
false
,
id
:
null
,
model
:
{},
isEdit
:
false
}
},
methods
:
{
// 库房
getStockRooms
()
{
getStockRooms
({
status
:
1
}).
then
(
res
=>
{
this
.
depotOptions
=
res
.
data
.
list
})
},
// 角色分配
fetchAllRoleList
()
{
fetchAllRoleList
().
then
(
response
=>
{
this
.
allRoleList
=
response
.
data
})
},
init
()
{
// this.fetchAllRoleList()
this
.
getStockRooms
()
this
.
$nextTick
(()
=>
{
this
.
$refs
.
myForm
.
clearValidate
()
this
.
$refs
.
scrollContainer
.
scrollTop
=
0
})
},
add
(
row
)
{
this
.
id
=
null
this
.
visible
=
true
this
.
init
()
this
.
model
=
{
departId
:
row
.
departId
,
roleId
:
null
,
stockRoomId
:
null
,
password
:
null
,
username
:
null
,
id
:
row
.
id
,
memberId
:
row
.
id
}
this
.
title
=
'设置管理员'
},
update
(
row
)
{
this
.
id
=
row
.
id
this
.
visible
=
true
this
.
init
()
this
.
model
=
{
stockRoomId
:
row
.
stockRoomId
,
id
:
row
.
id
}
this
.
title
=
'修改库房'
},
// detail(id) {
// this.id = id
// this.init()
// this.visible = true
// this.title = '编辑管理员'
// this.loading = true
// getSupplierDetail({ id: id }).then(res => {
// this.model = res.data
// this.loading = false
// }).catch(err => {
// this.loading = false
// this.close()
// })
// },
// 提交保存
submit
()
{
this
.
$refs
.
myForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
// 验证通过
// if (this.id) {
// // 修改属性
// this.loading = true
// updateMcht(this.model).then(res => {
// this.loading = false
// this.visible = false
// this.$emit('ok')
// }).catch(err => {
// this.loading = false
// })
// } else {
// 添加属性
this
.
loading
=
true
updateMember
(
this
.
model
).
then
(
res
=>
{
this
.
loading
=
false
this
.
visible
=
false
this
.
$emit
(
'ok'
)
}).
catch
(
err
=>
{
this
.
loading
=
false
})
// }
}
})
},
close
()
{
this
.
$emit
(
'close'
)
this
.
visible
=
false
}
}
}
</
script
>
<
style
scoped
>
.scroll-container
{
max-height
:
50vh
;
overflow
:
hidden
;
overflow-y
:
auto
;
}
.input-width
{
width
:
300px
;
}
.tip
{
color
:
#999
;
font-size
:
10px
;
line-height
:
30px
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment