Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhang Xiaojie
fns_backend
Commits
73a29199
Commit
73a29199
authored
Oct 09, 2021
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:网点管理新增网点
parent
26fb48b5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
350 additions
and
3 deletions
+350
-3
note.md
note.md
+2
-0
const.ts
src/components/HeaderSelect3/const.ts
+26
-0
index.vue
src/components/HeaderSelect3/index.vue
+280
-0
index.ts
src/service/AddressService/index.ts
+26
-3
types.ts
src/service/AddressService/types.ts
+16
-0
index.vue
src/views/Root/OutletManagement/index.vue
+0
-0
No files found.
note.md
View file @
73a29199
/staff/view
/staff/view
查询和某管理员同一个网点的 客服经理
查询和某管理员同一个网点的 客服经理
新增网点
src/components/HeaderSelect3/const.ts
0 → 100644
View file @
73a29199
export
const
fooList
=
[
{
label
:
'所属一级分行'
,
placeholder
:
'请选择一级分行'
,
options
:
[]
as
{
ID
:
number
;
Name
:
string
}[],
disable
:
false
,
value
:
undefined
as
number
|
undefined
,
propName
:
'firstBranch'
,
},
{
label
:
'所属二级分行'
,
placeholder
:
'请选择二级分行'
,
options
:
[]
as
{
ID
:
number
;
Name
:
string
}[],
disable
:
false
,
value
:
undefined
as
number
|
undefined
,
propName
:
'secondBranch'
,
},
{
label
:
'所属一级支行'
,
placeholder
:
'请选择一级支行'
,
options
:
[]
as
{
ID
:
number
;
Name
:
string
}[],
disable
:
false
,
value
:
undefined
as
number
|
undefined
,
propName
:
'firstSubBranch'
,
},
]
src/components/HeaderSelect3/index.vue
0 → 100644
View file @
73a29199
<
template
>
<div
class=
"header-select"
>
<FormModelItem
v-for=
"(item, index) in fooList"
:prop=
"item.propName"
class=
"base_form_item my-2"
style=
"position: relative"
:key=
"index"
:label=
"item.label"
>
<a-select
class=
"header-select-item my-2"
@
change=
"(value) => handleSelectChange(value, index)"
:placeholder=
"item.placeholder"
:value=
"item.value"
:disabled=
"index + 1
<
=
userLevel
?
true
:
item
.
disable
"
>
<a-select-option
:value=
"option.ID"
:key=
"option.ID"
v-for=
"option in item.options"
>
{{
option
.
Name
}}
</a-select-option
>
</a-select>
</FormModelItem>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
eLevel
}
from
"@/types/level"
;
import
{
message
}
from
"ant-design-vue"
;
import
StaffService
from
"@/service/StaffService"
;
import
{
fooList
}
from
"./const"
;
import
Vue
,
{
PropType
}
from
"vue"
;
import
{
iOutLet
}
from
"@/service/StaffService/types"
;
import
{
FormModel
}
from
"ant-design-vue"
;
import
{
getSelfOutLet
}
from
"@/utils/outlet"
;
import
{
getUserMsg
}
from
"@/utils/userMsg/userMsg"
;
import
{
eNewRoleRelatedToBackEnd
}
from
"@/types/role"
;
const
FormModelItem
=
FormModel
.
Item
;
export
default
Vue
.
extend
({
components
:
{
FormModelItem
,
FormModel
,
},
props
:
{
fooList
:
{
type
:
Array
as
PropType
<
typeof
fooList
>
,
},
setFooList
:
Function
,
level
:
Number
,
userLevel
:
Number
,
},
data
()
{
return
{};
},
mounted
()
{
this
.
init
();
},
methods
:
{
handleSelectChange
(
value
:
number
,
index
:
number
)
{
const
baseList
=
[...
this
.
fooList
];
baseList
[
index
].
value
=
value
;
const
newList
=
baseList
.
map
((
i
,
idx
)
=>
{
// idx > index && console.log(i);
return
{
...
i
,
options
:
idx
>
index
?
[]
:
i
.
options
,
value
:
idx
>
index
?
undefined
:
i
.
value
,
};
});
this
.
changeFooList
([...
newList
]);
index
+
1
!==
3
&&
this
.
fetchOptions
(
index
+
1
);
},
async
fetchOptions
(
index
:
number
)
{
const
ret
=
await
StaffService
.
getInstance
().
getBranch
({
level
:
index
+
1
,
page_size
:
10000
,
parent_id
:
this
.
fooList
[
index
-
1
].
value
,
});
if
(
ret
.
code
===
200
)
{
const
baseList
=
[...
this
.
fooList
];
baseList
[
index
].
options
=
ret
.
data
.
item
;
this
.
changeFooList
(
baseList
);
}
},
changeFooList
(
v
:
any
[])
{
let
lastIndexhasValue
=
true
;
const
newList
=
v
.
map
((
item
,
index
)
=>
{
if
(
index
>=
this
.
level
)
{
const
shouldDisable
=
!
lastIndexhasValue
;
lastIndexhasValue
=
item
.
value
!==
undefined
;
return
{
...
item
,
disable
:
shouldDisable
,
options
:
shouldDisable
?
[]
:
item
.
options
,
};
}
else
{
return
{
...
item
,
};
}
});
this
.
setFooList
(
newList
);
},
resetList
()
{
const
list
=
this
.
fooList
.
map
((
i
)
=>
{
return
{
...
i
,
disable
:
false
,
value
:
undefined
,
options
:
[],
};
});
this
.
setFooList
([...
list
]);
},
async
init
()
{
const
selfOutLet
=
await
getSelfOutLet
();
const
role
=
getUserMsg
()?.
newRole
;
this
.
resetList
();
this
.
$nextTick
(()
=>
{
if
(
role
===
eNewRoleRelatedToBackEnd
.
BackAdmin
)
{
this
.
initBackAdmin
(
selfOutLet
);
}
});
},
async
initBackAdmin
(
selfOutLet
:
iOutLet
)
{
const
ret
=
await
StaffService
.
getInstance
().
getBranch
({
level
:
eLevel
.
firstLevel_branch
,
});
if
(
ret
.
code
===
200
)
{
const
options
=
ret
.
data
.
item
;
const
baseList
=
[...
this
.
fooList
];
baseList
[
0
].
options
=
options
;
const
newList
=
baseList
.
map
((
item
,
i
)
=>
{
return
{
...
item
,
disable
:
i
>=
1
,
};
});
this
.
setFooList
(
newList
);
}
},
init_firstLevel
(
selfOutLet
:
iOutLet
)
{
const
list
=
this
.
initFooListBasicValues
(
selfOutLet
,
eLevel
.
firstLevel_branch
);
this
.
setFooList
(
list
);
},
async
init_secondLevel
(
selfOutLet
:
iOutLet
)
{
const
{
fid
,
first_branch
,
sid
,
second_branch
}
=
selfOutLet
;
const
list
=
this
.
initFooListBasicValues
(
selfOutLet
,
eLevel
.
secondary_branch
);
this
.
setFooList
(
list
);
const
ret
=
await
StaffService
.
getInstance
().
getBranch
({
level
:
eLevel
.
firstLevel_sub_branch
,
page_size
:
10000
,
parent_id
:
sid
,
});
const
baseList
=
[...
this
.
fooList
];
if
(
ret
.
code
===
200
)
{
baseList
[
2
].
options
=
ret
.
data
.
item
;
}
this
.
setFooList
(
baseList
);
},
async
init_first_sub_Level
(
selfOutLet
:
iOutLet
)
{
const
baseList
=
[...
this
.
fooList
];
const
{
fid
,
first_branch
,
sid
,
second_branch
,
fs_id
,
first_sub_branch
}
=
selfOutLet
;
const
list
=
this
.
initFooListBasicValues
(
selfOutLet
,
eLevel
.
firstLevel_sub_branch
);
this
.
setFooList
(
list
);
const
ret
=
await
StaffService
.
getInstance
().
getBranch
({
level
:
eLevel
.
secondary_sub_branch
,
page_size
:
1000
,
parent_id
:
fs_id
,
});
if
(
ret
.
code
===
200
)
{
baseList
[
3
].
options
=
ret
.
data
.
item
;
}
this
.
setFooList
(
baseList
);
},
init_second_sub_Level
(
selfOutLet
:
iOutLet
)
{
this
.
initFooListBasicValues
(
selfOutLet
,
eLevel
.
secondary_sub_branch
);
},
initFooListBasicValues
(
selfOutLet
:
iOutLet
,
level
:
eLevel
)
{
let
list
=
this
.
fooList
;
const
{
fid
,
first_branch
,
sid
,
second_branch
,
fs_id
,
first_sub_branch
,
ss_id
,
second_sub_branch
,
}
=
selfOutLet
;
if
(
[
eLevel
.
firstLevel_branch
,
eLevel
.
secondary_branch
,
eLevel
.
firstLevel_sub_branch
,
eLevel
.
secondary_sub_branch
,
].
includes
(
level
)
)
{
list
[
0
].
value
=
fid
;
list
[
0
].
options
=
[{
ID
:
fid
,
Name
:
first_branch
}];
list
[
0
].
disable
=
true
;
}
if
(
[
eLevel
.
secondary_branch
,
eLevel
.
firstLevel_sub_branch
,
eLevel
.
secondary_sub_branch
,
].
includes
(
level
)
)
{
list
[
1
].
value
=
sid
;
list
[
1
].
options
=
[{
ID
:
sid
,
Name
:
second_branch
}];
list
[
1
].
disable
=
true
;
}
if
(
[
eLevel
.
firstLevel_sub_branch
,
eLevel
.
secondary_sub_branch
].
includes
(
level
)
)
{
list
[
2
].
value
=
fs_id
;
list
[
2
].
options
=
[{
ID
:
fs_id
,
Name
:
first_sub_branch
}];
list
[
2
].
disable
=
true
;
}
if
([
eLevel
.
secondary_sub_branch
].
includes
(
level
))
{
list
[
3
].
value
=
ss_id
;
list
[
3
].
options
=
[{
ID
:
ss_id
,
Name
:
second_sub_branch
}];
list
[
3
].
disable
=
true
;
}
return
list
;
},
popupScroll1
(
e
:
Event
)
{
let
h
=
e
.
target
as
HTMLElement
;
if
(
h
.
scrollHeight
-
h
.
scrollTop
<=
h
.
clientHeight
)
{
message
.
info
(
"臣妾做不到啊"
);
}
},
popupScroll2
(
e
:
Event
)
{
let
h
=
e
.
target
as
HTMLElement
;
if
(
h
.
scrollHeight
-
h
.
scrollTop
<=
h
.
clientHeight
)
{
message
.
info
(
"臣妾做不到啊"
);
}
},
popupScroll3
(
e
:
Event
)
{
let
h
=
e
.
target
as
HTMLElement
;
if
(
h
.
scrollHeight
-
h
.
scrollTop
<=
h
.
clientHeight
)
{
message
.
info
(
"臣妾做不到啊"
);
}
},
popupScroll4
(
e
:
Event
)
{
let
h
=
e
.
target
as
HTMLElement
;
if
(
h
.
scrollHeight
-
h
.
scrollTop
<=
h
.
clientHeight
)
{
message
.
info
(
"臣妾做不到啊"
);
}
},
},
});
</
script
>
<
style
scoped
lang=
"less"
>
.header-select {
.header-select-item {
width: 200px;
}
}
</
style
>
\ No newline at end of file
src/service/AddressService/index.ts
View file @
73a29199
import
baseAxios
from
'../index'
import
baseAxios
from
'../index'
import
{
iOutLetDetail
}
from
'./types'
import
{
iOutLetDetail
,
iOutletMsg
}
from
'./types'
export
default
class
AddressService
{
export
default
class
AddressService
{
private
prefix
:
string
private
prefix
:
string
...
@@ -57,11 +57,17 @@ export default class AddressService {
...
@@ -57,11 +57,17 @@ export default class AddressService {
}
}
}
}
getOutlet
(
data
:
{
outlet_name
:
string
})
{
getOutlet
(
data
:
{
outlet_name
?:
string
;
id
?:
number
})
{
let
theData
=
{}
as
any
if
(
data
.
outlet_name
)
{
theData
.
name
=
data
.
outlet_name
}
else
if
(
data
.
id
!==
undefined
)
{
theData
.
id
=
data
.
id
}
return
baseAxios
<
iOutLetDetail
>
({
return
baseAxios
<
iOutLetDetail
>
({
url
:
'/address/getOutlet'
,
url
:
'/address/getOutlet'
,
method
:
'post'
,
method
:
'post'
,
data
,
data
:
theData
,
})
})
}
}
...
@@ -82,6 +88,7 @@ export default class AddressService {
...
@@ -82,6 +88,7 @@ export default class AddressService {
location
:
string
location
:
string
note
:
string
note
:
string
opening_hours
:
string
opening_hours
:
string
name
:
string
weekend_status
:
number
weekend_status
:
number
})
{
})
{
return
baseAxios
({
return
baseAxios
({
...
@@ -90,4 +97,20 @@ export default class AddressService {
...
@@ -90,4 +97,20 @@ export default class AddressService {
data
,
data
,
})
})
}
}
delete
(
data
:
{
id
:
number
})
{
return
baseAxios
({
url
:
'/address/delete'
,
method
:
'post'
,
data
,
})
}
add
(
data
:
iOutletMsg
)
{
return
baseAxios
({
url
:
'/address/add'
,
method
:
'post'
,
data
,
})
}
}
}
src/service/AddressService/types.ts
View file @
73a29199
...
@@ -8,4 +8,20 @@ export interface iOutLetDetail {
...
@@ -8,4 +8,20 @@ export interface iOutLetDetail {
opening_hours
:
string
opening_hours
:
string
outlet_name
:
string
outlet_name
:
string
region_name
:
string
region_name
:
string
weekend_status
:
number
province_name
:
string
}
export
interface
iOutletMsg
{
city_id
:
number
is_normal_work
:
boolean
lat_lon
:
string
location
:
string
name
:
string
note
:
string
opening_hours
:
string
province_id
:
number
region_id
:
number
region_name
:
string
weekend_status
?:
number
,
}
}
src/views/Root/OutletManagement/index.vue
View file @
73a29199
This diff is collapsed.
Click to expand it.
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