|
@@ -1,4 +1,4 @@
|
|
|
-import { Button, Tabs } from 'antd'
|
|
|
|
|
|
|
+import { Button, Popconfirm, Tabs } from 'antd'
|
|
|
import React, { useMemo } from 'react'
|
|
import React, { useMemo } from 'react'
|
|
|
import { dayjsFormat } from '@/utils/utils'
|
|
import { dayjsFormat } from '@/utils/utils'
|
|
|
import classNames from 'classnames'
|
|
import classNames from 'classnames'
|
|
@@ -65,6 +65,7 @@ type ClientLowerListProps = {
|
|
|
log: any[]
|
|
log: any[]
|
|
|
}
|
|
}
|
|
|
serviceList: API.ServiceLogItem[]
|
|
serviceList: API.ServiceLogItem[]
|
|
|
|
|
+ updatePayload: { main: string; target: string }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type ServiceLogItemProps = {
|
|
type ServiceLogItemProps = {
|
|
@@ -87,7 +88,7 @@ export const ServiceLogItem: React.FC<ServiceLogItemProps> = ({ item, logType, u
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
- const { run: truDel, loading: delLoading } = useRequest(
|
|
|
|
|
|
|
+ const { run: truDel } = useRequest(
|
|
|
logType === ServiceLogType.COMPANY ? delCustomerService : delClientService,
|
|
logType === ServiceLogType.COMPANY ? delCustomerService : delClientService,
|
|
|
{
|
|
{
|
|
|
manual: true,
|
|
manual: true,
|
|
@@ -152,14 +153,11 @@ export const ServiceLogItem: React.FC<ServiceLogItemProps> = ({ item, logType, u
|
|
|
<Button size="small" onClick={() => handleOnEdit(item)} loading={comfirmLoading}>
|
|
<Button size="small" onClick={() => handleOnEdit(item)} loading={comfirmLoading}>
|
|
|
编辑
|
|
编辑
|
|
|
</Button>
|
|
</Button>
|
|
|
- <Button
|
|
|
|
|
- size="small"
|
|
|
|
|
- danger
|
|
|
|
|
- loading={delLoading}
|
|
|
|
|
- onClick={() => truDel({ id: item.id })}
|
|
|
|
|
- className="ml-1">
|
|
|
|
|
- 删除
|
|
|
|
|
- </Button>
|
|
|
|
|
|
|
+ <Popconfirm title="确认删除该服务记录吗?" onConfirm={() => truDel({ id: item.id })}>
|
|
|
|
|
+ <Button size="small" danger className="ml-1">
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ </Popconfirm>
|
|
|
</div>
|
|
</div>
|
|
|
) : null}
|
|
) : null}
|
|
|
</div>
|
|
</div>
|
|
@@ -167,7 +165,11 @@ export const ServiceLogItem: React.FC<ServiceLogItemProps> = ({ item, logType, u
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const ClientLowerList: React.FC<ClientLowerListProps> = ({ logList: { log: logs = [] }, serviceList }) => {
|
|
|
|
|
|
|
+const ClientLowerList: React.FC<ClientLowerListProps> = ({
|
|
|
|
|
+ logList: { log: logs = [] },
|
|
|
|
|
+ serviceList,
|
|
|
|
|
+ updatePayload
|
|
|
|
|
+}) => {
|
|
|
const tableHeight = (document.body.clientHeight - 124 - 54 - 40 - 40 - 4) / 2
|
|
const tableHeight = (document.body.clientHeight - 124 - 54 - 40 - 40 - 4) / 2
|
|
|
const columns: ProColumns<API.LogItem>[] = [
|
|
const columns: ProColumns<API.LogItem>[] = [
|
|
|
{
|
|
{
|
|
@@ -213,7 +215,7 @@ const ClientLowerList: React.FC<ClientLowerListProps> = ({ logList: { log: logs
|
|
|
<div className="sheet-panel-record">
|
|
<div className="sheet-panel-record">
|
|
|
{serviceList.map(item => (
|
|
{serviceList.map(item => (
|
|
|
<div className="mb-3" key={item.id}>
|
|
<div className="mb-3" key={item.id}>
|
|
|
- <ServiceLogItem item={item} logType={ServiceLogType.CLIENT} />
|
|
|
|
|
|
|
+ <ServiceLogItem item={item} logType={ServiceLogType.CLIENT} updatePayload={updatePayload} />
|
|
|
</div>
|
|
</div>
|
|
|
))}
|
|
))}
|
|
|
</div>
|
|
</div>
|