Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
bdf82107
提交
bdf82107
authored
6月 09, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:客户列表联调
上级
fc671864
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
148 行增加
和
100 行删除
+148
-100
customManageType.ts
src/api/interface/customManageType.ts
+46
-2
customManage.ts
src/api/modules/customManage.ts
+15
-1
index.tsx
src/pages/customManage/customList/comp/changeModal/index.tsx
+48
-75
index.tsx
src/pages/customManage/customList/index.tsx
+38
-22
router.tsx
src/router/router.tsx
+1
-0
没有找到文件。
src/api/interface/customManageType.ts
浏览文件 @
bdf82107
import
{
InterListFunction
}
from
'~/api/interface'
;
import
{
Inter
Function
,
Inter
ListFunction
}
from
'~/api/interface'
;
// 客户列表
export
type
listAppUserType
=
InterListFunction
<
...
...
@@ -26,8 +26,52 @@ export type listAppUserType = InterListFunction<
portType
:
number
;
createTime
:
string
;
companyAuthStatus
:
number
;
cooperationTagId
:
nu
ll
;
cooperationTagId
:
nu
mber
;
companyName
:
null
;
tagName
:
null
;
}
>
;
// 加盟标签列表
export
type
CompanyListTag
=
InterFunction
<
NonNullable
<
unknown
>
,
{
id
:
number
;
tagName
:
string
;
tagImg
:
null
;
tagDescription
:
string
;
createTime
:
string
;
}[]
>
;
// 修改用户信息
export
type
userAccountUpdateType
=
InterFunction
<
{
accountNo
?:
string
;
accountStatus
?:
number
;
accountType
?:
number
;
companyAuthStatus
?:
number
;
companyName
?:
string
;
cooperationTagId
?:
number
;
createTime
?:
string
;
email
?:
string
;
id
:
number
;
nickName
?:
string
;
phoneNum
?:
string
;
portType
?:
number
;
remark
?:
string
;
source
?:
number
;
tagName
?:
string
;
uid
?:
string
;
userImg
?:
string
;
userName
?:
string
;
userSex
?:
number
;
},
NonNullable
<
unknown
>
>
;
// 后台设置小程序用户标签
export
type
changeUserTagType
=
InterFunction
<
{
cooperationTagId
:
number
;
userAccountId
:
number
;
},
NonNullable
<
unknown
>
>
;
src/api/modules/customManage.ts
浏览文件 @
bdf82107
import
axios
from
'../request'
;
import
{
listAppUserType
}
from
'~/api/interface/customManageType'
;
import
{
changeUserTagType
,
CompanyListTag
,
listAppUserType
,
userAccountUpdateType
,
}
from
'~/api/interface/customManageType'
;
export
class
CustomManageAPI
{
// 客户列表
static
listAppUser
:
listAppUserType
=
(
params
)
=>
axios
.
post
(
'/userapp/user-account/listAppUser'
,
params
);
// 加盟列表
static
CompanyListTag
:
CompanyListTag
=
(
params
)
=>
axios
.
get
(
'/userapp/cooperation/listTag'
,
{
params
});
// 客户列表
static
userAccountUpdate
:
userAccountUpdateType
=
(
params
)
=>
axios
.
post
(
'/userapp/user-account/update'
,
params
);
// 后台设置小程序用户标签
static
changeUserTag
:
changeUserTagType
=
(
params
)
=>
axios
.
get
(
'/userapp/cooperation/changeUserTag'
,
{
params
});
}
src/pages/customManage/customList/comp/changeModal/index.tsx
浏览文件 @
bdf82107
import
{
FC
,
useEffect
,
useState
}
from
'react'
;
import
{
Form
,
Modal
,
Select
}
from
'antd'
;
// import { tagLevelEntity } from "@/api/modules/user";
// import { UserAPI } from "@/api";
import
{
InterListType
}
from
'~/api/interface'
;
import
{
listAppUserType
}
from
'~/api/interface/customManageType'
;
import
{
CustomManageAPI
}
from
'~/api'
;
// 表格数据类型
type
TableType
=
InterListType
<
listAppUserType
>
;
// 数据的类型
interface
PropsType
{
visible
:
boolean
;
open
:
boolean
;
closed
:
any
;
data
:
any
;
state
:
any
;
data
?:
TableType
[
0
];
}
// 修改等级标签
interface
tagLevelForm
{
channelLevelId
:
number
;
mallOperator
:
number
;
mallSaleManager
:
number
;
cooperationTagId
:
number
;
}
export
const
ChangeModal
:
FC
<
PropsType
>
=
(
props
)
=>
{
ChangeModal
.
defaultProps
=
{
data
:
undefined
,
};
// 父组件传参
const
{
visible
,
closed
,
data
,
state
}
=
props
;
const
{
open
,
closed
,
data
}
=
props
;
// 个人等级标签
const
[
tagLevelF
orm
]
=
Form
.
useForm
<
tagLevelForm
>
();
const
[
f
orm
]
=
Form
.
useForm
<
tagLevelForm
>
();
// 相关运营列表
const
[
operationList
]
=
useState
([]);
const
[
operationList
]
=
useState
<
{
value
:
number
;
label
:
string
}[]
>
([]);
// 等级标签列表
const
[
cooperationTagIdList
,
setCooperationTagIdList
]
=
useState
<
{
value
:
number
;
label
:
string
}[]
>
([]);
// 关闭事件
const
handleClosed
=
()
=>
{
tagLevelF
orm
.
resetFields
();
f
orm
.
resetFields
();
closed
();
};
// 提交数据
const
handleSubmit
=
()
=>
{
tagLevelForm
.
validateFields
().
then
(
async
(
value
:
tagLevelForm
)
=>
{
// 提交表单数据
const
SubmitFuc
=
async
()
=>
{
// const res: any = await UserAPI.mallUserChangeInfo({
// ...value,
// userAccountId: data.id,
// });
// if (res.code === '200') {
// message.success('修改成功');
// handleClosed();
// } else {
// message.warning(res.message);
// }
};
// 如果之前填过等级标签,现在又删除了的话,调用删除等级标签的接口
if
(
data
.
channelClass
&&
!
value
.
channelLevelId
)
{
// 删除等级标签
// const res: any = await UserAPI.mallUserDeleteInfo({
// userAccountId: data.id,
// });
// if (res && res.code === '200') {
// await SubmitFuc();
// } else {
// message.warning(res.message);
// }
}
else
{
await
SubmitFuc
();
form
.
validateFields
().
then
(
async
(
value
)
=>
{
const
res
=
await
CustomManageAPI
.
changeUserTag
({
userAccountId
:
Number
(
data
?.
id
),
cooperationTagId
:
value
.
cooperationTagId
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
handleClosed
();
}
});
};
// 获取运营人员列表
const
getListOperate
=
()
=>
{
// UserAPI.getKbtUserList({ keyword: '' }).then(({ result }) => {
// if (result) {
// setOperationList(
// result.map((i: any) => {
// return {
// label: `${i.userName || i.nickName}(${i.uid})`,
// value: i.id,
// };
// }),
// );
// }
// });
// 获取加盟列表
const
getCompanyListTag
=
async
()
=>
{
const
res
=
await
CustomManageAPI
.
CompanyListTag
({});
if
(
res
&&
res
.
code
===
'200'
)
{
setCooperationTagIdList
(
res
.
result
.
map
((
i
)
=>
({
value
:
i
.
id
,
label
:
i
.
tagName
})));
// console.log(res.result);
}
};
// 组件启动
useEffect
(()
=>
{
if
(
data
)
{
getListOperate
();
tagLevelForm
.
setFieldsValue
({
channelLevelId
:
data
.
channelClass
||
undefined
,
mallOperator
:
data
.
mallOperator
||
undefined
,
mallSaleManager
:
data
.
mallSaleManager
||
undefined
,
});
}
},
[
data
]);
if
(
!
data
)
return
;
getCompanyListTag
().
then
();
form
.
setFieldsValue
({
cooperationTagId
:
data
.
cooperationTagId
,
});
},
[
open
]);
return
(
<
Modal
open=
{
visible
}
title=
'变更'
onCancel=
{
handleClosed
}
destroyOnClose
onOk=
{
handleSubmit
}
>
<
Form
form=
{
tagLevelF
orm
}
labelCol=
{
{
span
:
5
}
}
wrapperCol=
{
{
span
:
16
}
}
>
<
Form
.
Item
label=
'等级标签'
name=
'c
hannelLevel
Id'
>
<
Modal
open=
{
open
}
title=
'变更'
onCancel=
{
handleClosed
}
destroyOnClose
onOk=
{
handleSubmit
}
>
<
Form
form=
{
f
orm
}
labelCol=
{
{
span
:
5
}
}
wrapperCol=
{
{
span
:
16
}
}
>
<
Form
.
Item
label=
'等级标签'
name=
'c
ooperationTag
Id'
>
<
Select
placeholder=
'请选择等级标签'
disabled=
{
!
data
?.
realAuthStatus
&&
!
data
?.
entAuthStatus
}
disabled=
{
!
data
?.
userName
&&
!
data
?.
companyName
}
allowClear
>
{
state
.
levelTags
.
map
((
item
:
any
,
index
:
number
)
=>
(
<
Select
.
Option
value=
{
item
.
id
}
key=
{
index
}
>
{
item
.
tagName
}
</
Select
.
Option
>
))
}
</
Select
>
options=
{
cooperationTagIdList
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
'相关运营'
name=
'mallOperator'
>
<
Select
placeholder=
'请选择相关运营'
allowClear
>
<
Select
placeholder=
'请选择相关运营'
allowClear
disabled
>
{
operationList
.
map
((
item
:
any
,
index
:
number
)
=>
(
<
Select
.
Option
value=
{
item
.
value
}
key=
{
index
}
>
{
item
.
label
}
...
...
@@ -113,7 +86,7 @@ export const ChangeModal: FC<PropsType> = (props) => {
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
label=
'相关销售'
name=
'mallSaleManager'
>
<
Select
placeholder=
'请选择相关销售'
allowClear
>
<
Select
placeholder=
'请选择相关销售'
allowClear
disabled
>
{
operationList
.
map
((
item
:
any
,
index
:
number
)
=>
(
<
Select
.
Option
value=
{
item
.
value
}
key=
{
index
}
>
{
item
.
label
}
...
...
src/pages/customManage/customList/index.tsx
浏览文件 @
bdf82107
...
...
@@ -24,6 +24,10 @@ const portTypeList = [
];
function
CustomListView
()
{
// 等级标签列表
const
[
cooperationTagIdList
,
setCooperationTagIdList
]
=
useState
<
{
value
:
number
;
label
:
string
}[]
>
([]);
// 是否打开变更弹窗
const
[
isChangeVisModal
,
setIsChangeVisModal
]
=
useState
<
boolean
>
(
false
);
// 表格分页配置
...
...
@@ -36,7 +40,7 @@ function CustomListView() {
// 表格数据
const
[
tableData
,
setTableData
]
=
useState
<
TableType
>
([]);
// 需要编辑的数据
const
[
editData
]
=
useState
<
TableType
[
0
]
>
();
const
[
editData
,
setEditData
]
=
useState
<
TableType
[
0
]
>
();
// 加载列表
const
getTableList
=
async
(
value
=
{})
=>
{
// 只需要修改这个地方的接口即可
...
...
@@ -68,10 +72,21 @@ function CustomListView() {
query
=
data
;
getTableList
(
data
).
then
();
};
// 获取加盟列表
const
getCompanyListTag
=
async
()
=>
{
const
res
=
await
CustomManageAPI
.
CompanyListTag
({});
if
(
res
&&
res
.
code
===
'200'
)
{
setCooperationTagIdList
(
res
.
result
.
map
((
i
)
=>
({
value
:
i
.
id
,
label
:
i
.
tagName
})));
// console.log(res.result);
}
};
// componentDidMount
useEffect
(()
=>
{
query
=
{};
getTableList
().
then
();
(
async
()
=>
{
await
getCompanyListTag
();
await
getTableList
();
})();
},
[]);
// 表格结构
const
columns
:
ColumnsType
<
TableType
[
0
]
>
=
[
...
...
@@ -131,7 +146,7 @@ function CustomListView() {
title
:
'渠道等级'
,
dataIndex
:
'cooperationTagId'
,
align
:
'center'
,
render
:
(
text
)
=>
text
,
render
:
(
text
)
=>
cooperationTagIdList
.
find
((
i
)
=>
i
.
value
===
text
)?.
label
||
text
,
},
{
title
:
'上级推荐人'
,
...
...
@@ -162,12 +177,13 @@ function CustomListView() {
dataIndex
:
'action'
,
align
:
'center'
,
fixed
:
'right'
,
width
:
'1
5
0px'
,
render
:
(
_text
)
=>
(
width
:
'1
0
0px'
,
render
:
(
_text
,
record
)
=>
(
<>
<
Button
type=
{
'link'
}
onClick=
{
()
=>
{
setEditData
(
JSON
.
parse
(
JSON
.
stringify
(
record
)));
setIsChangeVisModal
(
true
);
}
}
>
...
...
@@ -198,37 +214,37 @@ function CustomListView() {
},
{
label
:
'来源'
,
name
:
'
form
'
,
name
:
'
portType
'
,
type
:
'Select'
,
placeholder
:
'请选择相关来源'
,
options
:
portTypeList
,
},
{
label
:
'创建时间'
,
name
:
'
t
ime'
,
name
:
'
rangeT
ime'
,
type
:
'rangePicker'
,
placeholder
:
'请选择创建时间'
,
},
{
label
:
'企业认证'
,
name
:
'enterprise'
,
type
:
'Select'
,
placeholder
:
'请选择是否认证'
,
options
:
[
{
value
:
1
,
label
:
'未认证'
},
{
value
:
2
,
label
:
'已认证'
},
],
},
{
label
:
'电子签约认证'
,
name
:
'contract'
,
name
:
'companyAuthStatus'
,
type
:
'Select'
,
placeholder
:
'请选择是否认证'
,
options
:
[
{
value
:
1
,
label
:
'未认证'
},
{
value
:
2
,
label
:
'已认证'
},
{
value
:
0
,
label
:
'未认证'
},
{
value
:
1
,
label
:
'已认证'
},
],
},
//
{
// label: '电子签约认证',
// name: 'contract',
// type: 'Select',
// placeholder: '请选择是否认证',
// options: [
//
{
value
:
1
,
label
:
'未认证'
},
//
{
value
:
2
,
label
:
'已认证'
},
// ],
//
},
]
}
searchData=
{
onFinish
}
/>
...
...
@@ -250,12 +266,12 @@ function CustomListView() {
// rowSelection={{ selectedRowKeys, onChange: onSelectChange }}
/>
<
ChangeModal
visible
=
{
isChangeVisModal
}
open
=
{
isChangeVisModal
}
closed=
{
()
=>
{
setIsChangeVisModal
(
false
);
paginationChange
(
pagination
.
current
,
pagination
.
pageSize
);
}
}
data=
{
editData
}
state=
{
{
levelTags
:
[]
}
}
/>
</>
);
...
...
src/router/router.tsx
浏览文件 @
bdf82107
...
...
@@ -443,6 +443,7 @@ export const routerList: Array<RouteObjectType> = [
id
:
26200
,
title
:
'现金管理'
,
icon
:
<
RedEnvelopeOutlined
/>,
hidden
:
true
,
},
},
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论