Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
e79e1c55
提交
e79e1c55
authored
7月 29, 2023
作者:
龚洪江
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:单位加盟联调完成
上级
73bff0fe
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
234 行增加
和
49 行删除
+234
-49
commonType.ts
src/api/interface/commonType.ts
+2
-0
systemManageType.ts
src/api/interface/systemManageType.ts
+10
-0
systemManage.ts
src/api/modules/systemManage.ts
+8
-0
index.tsx
src/pages/categoryManage/categoryList/index.tsx
+1
-0
index.tsx
...Goods/goodsAddOrEditOrDetail/components/skuInfo/index.tsx
+30
-3
index.tsx
src/pages/mallManage/mallGoods/goodsList/index.tsx
+1
-0
index.tsx
...ge/companyDetail/components/transferLeaderModal/index.tsx
+75
-0
index.tsx
src/pages/systemManage/companyManage/companyDetail/index.tsx
+82
-7
index.tsx
...age/companyManage/companyList/comp/addEditModal/index.tsx
+25
-39
没有找到文件。
src/api/interface/commonType.ts
浏览文件 @
e79e1c55
...
...
@@ -11,6 +11,7 @@ export type BackEndLoginType = InterFunction<
phoneNum
:
string
;
userName
:
string
;
nickName
:
string
;
appUserAccountId
?:
number
;
companyInfoVO
:
{
id
:
number
;
companyType
:
number
;
...
...
@@ -23,6 +24,7 @@ export type BackEndLoginType = InterFunction<
companyUserName
:
string
;
phoneNum
:
string
;
remark
:
string
;
leader
:
number
;
};
roleInfo
:
{
id
:
number
;
...
...
src/api/interface/systemManageType.ts
浏览文件 @
e79e1c55
...
...
@@ -249,6 +249,16 @@ export type bindingCompanyMemberType = InterFunction<
{
companyInfoId
:
number
;
userAccountId
:
number
},
any
>
;
//单位-成员解绑
export
type
unbindCompanyMemberType
=
InterFunction
<
{
companyInfoId
:
number
;
userAccountId
:
number
},
any
>
;
//单位-管理员转让
export
type
transferLeaderType
=
InterFunction
<
{
companyInfoId
:
number
;
fromUserAccountId
:
number
;
toUserAccountId
:
number
},
any
>
;
//账号权限-列表
export
type
listRoleInfoPageType
=
InterItemFunction
<
...
...
src/api/modules/systemManage.ts
浏览文件 @
e79e1c55
...
...
@@ -15,6 +15,8 @@ import {
listRoleInfoPageType
,
listRoleMenuInfoType
,
removeBAccountType
,
transferLeaderType
,
unbindCompanyMemberType
,
updateBAccountType
,
updatePasswordType
,
updateRoleInfoType
,
...
...
@@ -74,6 +76,12 @@ export class SystemManageAPI {
//单位-成员绑定
static
bindingCompanyMember
:
bindingCompanyMemberType
=
(
params
)
=>
axios
.
get
(
'/userapp/company/bindingCompanyMember'
,
{
params
});
//单位-成员解除绑定
static
unbindCompanyMember
:
unbindCompanyMemberType
=
(
params
)
=>
axios
.
get
(
'/userapp/company/unbindCompanyMember'
,
{
params
});
//单位-管理员转让
static
transferLeader
:
transferLeaderType
=
(
params
)
=>
axios
.
get
(
'/userapp/company/transferLeader'
,
{
params
});
//账号权限-列表
static
getListRoleInfoPage
:
listRoleInfoPageType
=
(
data
)
=>
...
...
src/pages/categoryManage/categoryList/index.tsx
浏览文件 @
e79e1c55
...
...
@@ -222,6 +222,7 @@ const CategoryList = () => {
pagination
.
pageNo
-=
1
;
}
getCategoryList
();
getCategoryList
({
pageNo
:
1
,
pageSize
:
99999
},
true
);
}
});
},
...
...
src/pages/mallManage/mallGoods/goodsAddOrEditOrDetail/components/skuInfo/index.tsx
浏览文件 @
e79e1c55
import
{
Button
,
Popconfirm
,
Table
,
Tag
}
from
'antd'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
FC
}
from
'react'
;
import
{
InterDataType
,
InterReqType
}
from
'~/api/interface'
;
import
{
FC
,
useState
}
from
'react'
;
import
{
InterDataType
,
InterReqType
,
PaginationProps
}
from
'~/api/interface'
;
import
{
addMallGoodsType
,
skuUnitType
}
from
'~/api/interface/goodsType'
;
//商品sku规格类型
...
...
@@ -89,6 +89,16 @@ const SkuInfo: FC<selfProps> = ({
),
},
];
const
[
pagination
,
setPagination
]
=
useState
<
PaginationProps
>
({
pageNo
:
1
,
pageSize
:
10
,
});
//分页
const
paginationChange
=
(
pageNo
:
number
,
pageSize
:
number
)
=>
{
pagination
.
pageNo
=
pageNo
;
pagination
.
pageSize
=
pageSize
;
setPagination
({
...
pagination
});
};
return
(
<
div
className=
'sku-info'
>
...
...
@@ -101,7 +111,24 @@ const SkuInfo: FC<selfProps> = ({
添加规格
</
Button
>
</
div
>
<
Table
bordered
columns=
{
tableColumns
}
dataSource=
{
skuTableData
}
rowKey=
'id'
/>
<
Table
bordered
columns=
{
tableColumns
}
dataSource=
{
skuTableData
.
slice
(
(
pagination
.
pageNo
-
1
)
*
pagination
.
pageSize
,
pagination
.
pageNo
*
pagination
.
pageSize
,
)
}
rowKey=
'id'
pagination=
{
{
total
:
skuTableData
.
length
,
pageSize
:
pagination
.
pageSize
,
current
:
pagination
.
pageNo
,
showSizeChanger
:
true
,
showQuickJumper
:
true
,
onChange
:
(
page
:
number
,
pageSize
:
number
)
=>
paginationChange
(
page
,
pageSize
),
showTotal
:
(
total
,
range
)
=>
`当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`
,
}
}
/>
</
div
>
);
};
...
...
src/pages/mallManage/mallGoods/goodsList/index.tsx
浏览文件 @
e79e1c55
...
...
@@ -147,6 +147,7 @@ const GoodsList = () => {
const
paginationChange
=
(
pageNo
:
number
,
pageSize
:
number
)
=>
{
pagination
.
pageNo
=
pageNo
;
pagination
.
pageSize
=
pageSize
;
setSelectedRowKeys
([]);
setSearchParams
(
qs
.
stringify
({
pageNo
:
pageNo
,
...
...
src/pages/systemManage/companyManage/companyDetail/components/transferLeaderModal/index.tsx
0 → 100644
浏览文件 @
e79e1c55
import
{
Form
,
message
,
Modal
,
ModalProps
,
Select
}
from
'antd'
;
import
{
FC
,
useEffect
,
useState
}
from
'react'
;
import
{
SystemManageAPI
}
from
'~/api'
;
import
{
InterDataType
}
from
'~/api/interface'
;
import
{
listCompanyMembersType
}
from
'~/api/interface/systemManageType'
;
//单位-成员列表返回类型
type
companyMembersType
=
InterDataType
<
listCompanyMembersType
>
[
'list'
];
interface
selfProps
{
onOk
:
()
=>
void
;
companyInfoId
:
number
;
currentCompanyMembers
:
companyMembersType
[
0
]
|
undefined
;
}
const
TransferLeaderModal
:
FC
<
ModalProps
&
selfProps
>
=
({
open
,
onOk
,
onCancel
,
companyInfoId
,
currentCompanyMembers
,
})
=>
{
const
[
form
]
=
Form
.
useForm
<
{
toUserAccountId
:
number
}
>
();
const
[
listCompanyMembers
,
setListCompanyMembers
]
=
useState
<
companyMembersType
>
([]);
const
handleOk
=
()
=>
{
form
.
validateFields
().
then
((
values
)
=>
{
if
(
currentCompanyMembers
)
{
SystemManageAPI
.
transferLeader
({
companyInfoId
,
fromUserAccountId
:
currentCompanyMembers
.
id
,
...
values
,
}).
then
(({
code
})
=>
{
if
(
code
===
'200'
)
{
message
.
success
(
'转让成功'
);
onOk
();
}
});
}
});
};
//单位成员列表
const
getListCompanyMembers
=
()
=>
{
SystemManageAPI
.
getListCompanyMembers
({
companyInfoId
,
pageNo
:
1
,
pageSize
:
999999
,
}).
then
(({
result
})
=>
{
setListCompanyMembers
((
result
.
list
||
[]).
filter
((
v
)
=>
!
v
.
leader
));
});
};
useEffect
(()
=>
{
if
(
currentCompanyMembers
)
{
getListCompanyMembers
();
}
},
[
currentCompanyMembers
]);
return
(
<
Modal
open=
{
open
}
title=
'转让管理员'
onCancel=
{
onCancel
}
onOk=
{
handleOk
}
>
<
Form
form=
{
form
}
>
<
Form
.
Item
label=
'转让人'
name=
'toUserAccountId'
>
<
Select
placeholder=
'请选择受让人'
filterOption=
{
(
input
,
option
)
=>
(
option
!
.
children
as
unknown
as
string
).
toLowerCase
().
includes
(
input
.
toLowerCase
())
}
>
{
listCompanyMembers
.
map
((
v
)
=>
(
<
Select
.
Option
key=
{
v
.
id
}
value=
{
v
.
id
}
>
{
v
.
phoneNum
}
(
{
v
.
uid
}
)
</
Select
.
Option
>
))
}
</
Select
>
</
Form
.
Item
>
</
Form
>
</
Modal
>
);
};
export
default
TransferLeaderModal
;
src/pages/systemManage/companyManage/companyDetail/index.tsx
浏览文件 @
e79e1c55
...
...
@@ -3,11 +3,13 @@ import { useEffect, useState } from 'react';
import
{
SystemManageAPI
}
from
'~/api'
;
import
{
InterDataType
,
PaginationProps
}
from
'~/api/interface'
;
import
{
getCompanyInfoByIdType
,
listCompanyMembersType
}
from
'~/api/interface/systemManageType'
;
import
{
Button
,
Descriptions
,
Table
}
from
'antd'
;
import
{
Button
,
Descriptions
,
message
,
Modal
,
Table
}
from
'antd'
;
import
'./index.scss'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
AddPeopleModal
from
'./components/addPeopleModal'
;
import
{
useSelector
}
from
'react-redux'
;
import
TransferLeaderModal
from
'~/pages/systemManage/companyManage/companyDetail/components/transferLeaderModal'
;
//单位详情-返回类型
type
companyDetailType
=
InterDataType
<
getCompanyInfoByIdType
>
;
...
...
@@ -16,6 +18,7 @@ type companyMembersType = InterDataType<listCompanyMembersType>['list'];
const
CompanyDetail
=
()
=>
{
const
[
searchParams
]
=
useSearchParams
();
const
{
userInfo
}
=
useSelector
((
state
:
any
)
=>
state
.
UserInfo
);
const
tableColumns
:
ColumnsType
<
companyMembersType
[
0
]
>
=
[
{
...
...
@@ -29,18 +32,40 @@ const CompanyDetail = () => {
dataIndex
:
'userName'
,
},
{
title
:
'角色'
,
align
:
'center'
,
dataIndex
:
'leader'
,
render
:
(
text
:
number
)
=>
(
text
?
'单位管理员'
:
'普通员工'
),
},
{
title
:
'手机号'
,
align
:
'center'
,
dataIndex
:
'phoneNum'
,
},
{
title
:
'操作'
,
align
:
'center'
,
width
:
'15%'
,
render
:
()
=>
(
onHeaderCell
:
()
=>
({
style
:
{
textAlign
:
'center'
,
},
}),
render
:
(
_text
:
string
,
record
)
=>
(
<>
<
Button
type=
'link'
>
转让
</
Button
>
<
Button
type=
'link'
>
解绑
</
Button
>
<
Button
type=
'link'
disabled=
{
!
userInfo
.
companyInfoVO
.
leader
||
!
record
.
leader
}
onClick=
{
()
=>
transferLeaderClick
(
record
)
}
>
转让
</
Button
>
<
Button
type=
'link'
disabled=
{
!
userInfo
.
companyInfoVO
.
leader
||
!!
record
.
leader
}
onClick=
{
()
=>
unbindCompanyClick
(
record
)
}
>
解绑
</
Button
>
</>
),
},
...
...
@@ -53,8 +78,10 @@ const CompanyDetail = () => {
pageSize
:
10
,
totalCount
:
0
,
});
const
[
listCompanyMembers
,
setListCompanyMembers
]
=
useState
<
companyMembersType
>
();
const
[
listCompanyMembers
,
setListCompanyMembers
]
=
useState
<
companyMembersType
>
([]);
const
[
currentCompanyMembers
,
setCurrentCompanyMembers
]
=
useState
<
companyMembersType
[
0
]
>
();
const
[
addPeopleModalShow
,
setAddPeopleModalShow
]
=
useState
<
boolean
>
(
false
);
const
[
transferLeaderModalShow
,
setTransferLeaderModalShow
]
=
useState
<
boolean
>
(
false
);
//单位详情
const
getCompanyDetailInfo
=
(
id
:
number
)
=>
{
...
...
@@ -85,11 +112,45 @@ const CompanyDetail = () => {
setAddPeopleModalShow
(
true
);
};
const
addPeopleModalOk
=
()
=>
{
getListCompanyMembers
(
companyId
);
setAddPeopleModalShow
(
false
);
};
const
addPeopleModalCancel
=
()
=>
{
setAddPeopleModalShow
(
false
);
};
//转让管理员弹窗
const
transferLeaderClick
=
(
record
:
companyMembersType
[
0
])
=>
{
setCurrentCompanyMembers
(
record
);
setTransferLeaderModalShow
(
true
);
};
const
transferLeaderModalCancel
=
()
=>
{
setTransferLeaderModalShow
(
false
);
};
const
transferLeaderModalOk
=
()
=>
{
setTransferLeaderModalShow
(
false
);
getListCompanyMembers
(
companyId
);
};
//接触绑定
const
unbindCompanyClick
=
(
record
:
companyMembersType
[
0
])
=>
{
Modal
.
confirm
({
title
:
'提示'
,
content
:
'确认解除绑定该成员?'
,
onOk
:
()
=>
{
SystemManageAPI
.
unbindCompanyMember
({
userAccountId
:
record
.
id
,
companyInfoId
:
companyId
,
}).
then
(({
code
})
=>
{
if
(
code
===
'200'
)
{
message
.
success
(
'解除成功'
);
if
(
pagination
.
pageNo
!==
1
&&
listCompanyMembers
?.
length
===
1
)
{
pagination
.
pageNo
-=
1
;
}
getListCompanyMembers
(
companyId
);
}
});
},
});
};
useEffect
(()
=>
{
setCompanyId
(
Number
(
searchParams
.
get
(
'id'
)));
...
...
@@ -112,7 +173,12 @@ const CompanyDetail = () => {
<
div
className=
'company-detail-people'
>
<
div
className=
'company-detail-people-title'
>
成员信息
</
div
>
<
div
className=
'company-detail-people-operate'
>
<
Button
type=
'primary'
icon=
{
<
PlusOutlined
></
PlusOutlined
>
}
onClick=
{
addPeopleClick
}
>
<
Button
type=
'primary'
icon=
{
<
PlusOutlined
></
PlusOutlined
>
}
onClick=
{
addPeopleClick
}
disabled=
{
!
userInfo
.
companyInfoVO
.
leader
}
>
添加成员
</
Button
>
</
div
>
...
...
@@ -134,12 +200,21 @@ const CompanyDetail = () => {
<
div
className=
'company-detail-operate'
>
<
Button
type=
'primary'
>
返回
</
Button
>
</
div
>
{
/*添加成员*/
}
<
AddPeopleModal
open=
{
addPeopleModalShow
}
onCancel=
{
addPeopleModalCancel
}
onOk=
{
addPeopleModalOk
}
companyInfoId=
{
companyId
}
/>
{
/*转让管理员*/
}
<
TransferLeaderModal
open=
{
transferLeaderModalShow
}
onCancel=
{
transferLeaderModalCancel
}
onOk=
{
transferLeaderModalOk
}
companyInfoId=
{
companyId
}
currentCompanyMembers=
{
currentCompanyMembers
}
/>
</
div
>
);
};
...
...
src/pages/systemManage/companyManage/companyList/comp/addEditModal/index.tsx
浏览文件 @
e79e1c55
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
}
from
'react'
;
import
{
InterListType
,
InterReqType
}
from
'~/api/interface'
;
import
{
listCompanyAdd
,
listCompanyPage
}
from
'~/api/interface/systemManageType'
;
import
{
Cascader
,
Form
,
Input
,
message
,
Modal
}
from
'antd'
;
import
{
Form
,
Input
,
message
,
Modal
}
from
'antd'
;
import
{
SystemManageAPI
}
from
'~/api'
;
import
DistrictData
from
'~/assets/json/district.json'
;
// 列表的类型
type
TableType
=
InterListType
<
listCompanyPage
>
;
...
...
@@ -21,14 +20,6 @@ const AddEditModal: React.FC<propType> = (props) => {
const
{
title
,
open
,
closed
,
data
}
=
props
;
/// 表单钩子
const
[
form
]
=
Form
.
useForm
<
ReqType
>
();
// 地区
const
[
localList
,
setLocalList
]
=
useState
<
{
childInfo
:
any
[];
id
:
number
;
name
:
string
;
}[]
>
();
// 关闭弹窗
const
handleCancel
=
()
=>
{
form
.
resetFields
();
...
...
@@ -66,14 +57,9 @@ const AddEditModal: React.FC<propType> = (props) => {
handleCancel
();
}
};
// 获取地区信息
const
getSecondDistrictInfo
=
async
()
=>
{
setLocalList
(
DistrictData
||
[]);
};
// componentDidMount
useEffect
(()
=>
{
if
(
!
open
)
return
;
getSecondDistrictInfo
().
then
();
if
(
!
data
)
return
;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
...
...
@@ -100,29 +86,29 @@ const AddEditModal: React.FC<propType> = (props) => {
>
<
Input
placeholder=
{
'请输入单位名称'
}
maxLength=
{
25
}
allowClear
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'单位全称'
rules=
{
[{
required
:
false
,
message
:
'请输入单位全称'
}]
}
name=
'fullName'
>
<
Input
placeholder=
{
'请输入单位全称'
}
maxLength=
{
50
}
allowClear
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'行政区划'
name=
'area'
rules=
{
[{
required
:
true
,
message
:
'请选择行政区划'
}]
}
>
<
Cascader
options=
{
localList
}
placeholder=
'请选择行政区划'
allowClear
fieldNames=
{
{
label
:
'name'
,
value
:
'name'
,
children
:
'childInfo'
,
}
}
/>
</
Form
.
Item
>
{
/*<Form.Item*/
}
{
/* label='单位全称'*/
}
{
/* rules={[{ required: false, message: '请输入单位全称' }]}*/
}
{
/* name='fullName'*/
}
{
/*>*/
}
{
/* <Input placeholder={'请输入单位全称'} maxLength={50} allowClear />*/
}
{
/*</Form.Item>*/
}
{
/*<Form.Item*/
}
{
/* label='行政区划'*/
}
{
/* name='area'*/
}
{
/* rules={[{ required: true, message: '请选择行政区划' }]}*/
}
{
/*>*/
}
{
/* <Cascader*/
}
{
/* options={localList}*/
}
{
/* placeholder='请选择行政区划'*/
}
{
/* allowClear*/
}
{
/* fieldNames={{*/
}
{
/* label: 'name',*/
}
{
/* value: 'name',*/
}
{
/* children: 'childInfo',*/
}
{
/* }}*/
}
{
/* />*/
}
{
/*</Form.Item>*/
}
<
Form
.
Item
label=
'详细地址'
name=
'address'
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论