|
@@ -77,21 +77,24 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
pageSize: 100
|
|
pageSize: 100
|
|
|
})
|
|
})
|
|
|
if (code === consts.RET_CODE.SUCCESS && canSetState) {
|
|
if (code === consts.RET_CODE.SUCCESS && canSetState) {
|
|
|
|
|
+ // list存起来,同时将员工列表id整个塞进params获取当前部门所有人的数据(变向)
|
|
|
setState({
|
|
setState({
|
|
|
...state,
|
|
...state,
|
|
|
- staffList: list
|
|
|
|
|
|
|
+ staffList: list,
|
|
|
|
|
+ params: { ...state.params, staffIds: list.map(item => item.id) }
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
return list
|
|
return list
|
|
|
}
|
|
}
|
|
|
const handleStaffClick = id => {
|
|
const handleStaffClick = id => {
|
|
|
const sId = `s_${id}`
|
|
const sId = `s_${id}`
|
|
|
- if (state.params.staffIds?.includes(sId)) {
|
|
|
|
|
|
|
+ // 反选,调整回选择部门下的所有人
|
|
|
|
|
+ if (state.params.staffIds?.length === 1 && state.params.staffIds?.includes(sId)) {
|
|
|
setState({
|
|
setState({
|
|
|
...state,
|
|
...state,
|
|
|
selectId: null,
|
|
selectId: null,
|
|
|
immediate: true,
|
|
immediate: true,
|
|
|
- params: { ...state.params, staffIds: null }
|
|
|
|
|
|
|
+ params: { ...state.params, staffIds: state.staffList.map(item => `s_${item.id}`) }
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -188,8 +191,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
render: (name, record) => (
|
|
render: (name, record) => (
|
|
|
<span
|
|
<span
|
|
|
onClick={() => handleReminderList(record.type, '7day')}
|
|
onClick={() => handleReminderList(record.type, '7day')}
|
|
|
- className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd">
|
|
|
{name}
|
|
{name}
|
|
|
</span>
|
|
</span>
|
|
|
)
|
|
)
|
|
@@ -200,8 +202,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
render: (name, record) => (
|
|
render: (name, record) => (
|
|
|
<span
|
|
<span
|
|
|
onClick={() => handleReminderList(record.type, '15day')}
|
|
onClick={() => handleReminderList(record.type, '15day')}
|
|
|
- className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd">
|
|
|
{name}
|
|
{name}
|
|
|
</span>
|
|
</span>
|
|
|
)
|
|
)
|
|
@@ -212,8 +213,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
render: (name, record) => (
|
|
render: (name, record) => (
|
|
|
<span
|
|
<span
|
|
|
onClick={() => handleReminderList(record.type, '30day')}
|
|
onClick={() => handleReminderList(record.type, '30day')}
|
|
|
- className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd">
|
|
|
{name}
|
|
{name}
|
|
|
</span>
|
|
</span>
|
|
|
)
|
|
)
|
|
@@ -224,8 +224,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
render: (name, record) => (
|
|
render: (name, record) => (
|
|
|
<span
|
|
<span
|
|
|
onClick={() => handleReminderList(record.type, '3month')}
|
|
onClick={() => handleReminderList(record.type, '3month')}
|
|
|
- className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd">
|
|
|
{name}
|
|
{name}
|
|
|
</span>
|
|
</span>
|
|
|
)
|
|
)
|
|
@@ -236,8 +235,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
render: (name, record) => (
|
|
render: (name, record) => (
|
|
|
<span
|
|
<span
|
|
|
onClick={() => handleReminderList(record.type, '9month')}
|
|
onClick={() => handleReminderList(record.type, '9month')}
|
|
|
- className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd">
|
|
|
{name}
|
|
{name}
|
|
|
</span>
|
|
</span>
|
|
|
)
|
|
)
|
|
@@ -250,8 +248,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
render: (_, record) => (
|
|
render: (_, record) => (
|
|
|
<span
|
|
<span
|
|
|
onClick={() => handleReminderList(record.type, 'expiry')}
|
|
onClick={() => handleReminderList(record.type, 'expiry')}
|
|
|
- className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd">
|
|
|
{record.remind.expiry}
|
|
{record.remind.expiry}
|
|
|
</span>
|
|
</span>
|
|
|
)
|
|
)
|
|
@@ -262,8 +259,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
render: (_, record) => (
|
|
render: (_, record) => (
|
|
|
<span
|
|
<span
|
|
|
onClick={() => handleReminderList(record.type, 'unexpired')}
|
|
onClick={() => handleReminderList(record.type, 'unexpired')}
|
|
|
- className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd">
|
|
|
{record.remind.unexpired}
|
|
{record.remind.unexpired}
|
|
|
</span>
|
|
</span>
|
|
|
)
|
|
)
|
|
@@ -408,8 +404,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
[styles.active]: state.selectId === item.id
|
|
[styles.active]: state.selectId === item.id
|
|
|
})}
|
|
})}
|
|
|
key={item.id}
|
|
key={item.id}
|
|
|
- onClick={() => handleStaffClick(item.id)}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ onClick={() => handleStaffClick(item.id)}>
|
|
|
<img
|
|
<img
|
|
|
className="w-full max-w-30px h-30px border rounded-30px"
|
|
className="w-full max-w-30px h-30px border rounded-30px"
|
|
|
src={
|
|
src={
|
|
@@ -441,8 +436,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
className={[
|
|
className={[
|
|
|
'text-xl',
|
|
'text-xl',
|
|
|
state.clientChainRatio.percentage.startsWith('-') ? 'text-green-500' : 'text-red-500'
|
|
state.clientChainRatio.percentage.startsWith('-') ? 'text-green-500' : 'text-red-500'
|
|
|
- ].join(' ')}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ ].join(' ')}>
|
|
|
{state.clientChainRatio.percentage}
|
|
{state.clientChainRatio.percentage}
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -475,8 +469,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
state.customerChainRatio.percentage.startsWith('-')
|
|
state.customerChainRatio.percentage.startsWith('-')
|
|
|
? 'text-green-500'
|
|
? 'text-green-500'
|
|
|
: 'text-red-500'
|
|
: 'text-red-500'
|
|
|
- ].join(' ')}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ ].join(' ')}>
|
|
|
{state.customerChainRatio.percentage}
|
|
{state.customerChainRatio.percentage}
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -548,8 +541,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
state.serviceLogChainRatio.percentage.startsWith('-')
|
|
state.serviceLogChainRatio.percentage.startsWith('-')
|
|
|
? 'text-green-500'
|
|
? 'text-green-500'
|
|
|
: 'text-red-500'
|
|
: 'text-red-500'
|
|
|
- ].join(' ')}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ ].join(' ')}>
|
|
|
{state.serviceLogChainRatio.percentage}
|
|
{state.serviceLogChainRatio.percentage}
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -580,8 +572,7 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
title="数据汇总"
|
|
title="数据汇总"
|
|
|
className="shadow-card"
|
|
className="shadow-card"
|
|
|
bodyStyle={{ padding: state.loading ? '24px' : 0 }}
|
|
bodyStyle={{ padding: state.loading ? '24px' : 0 }}
|
|
|
- loading={state.loading}
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ loading={state.loading}>
|
|
|
<ul>
|
|
<ul>
|
|
|
<li className="px-12px py-16px border-b-1">
|
|
<li className="px-12px py-16px border-b-1">
|
|
|
新增客户<b className="px-1">{state.aggregation.clientCount}</b>个,服务
|
|
新增客户<b className="px-1">{state.aggregation.clientCount}</b>个,服务
|