Commit f611fc4d authored by Bill's avatar Bill

Merge branch 'dev' of 10.0.0.22:lingxi/lingxi-business-paltform into dev

parents 4d45b3bb d66023ca
...@@ -7,10 +7,17 @@ ...@@ -7,10 +7,17 @@
*/ */
import React from 'react'; import React from 'react';
import { Upload } from 'antd'; import { Upload } from 'antd';
import { FileData } from '@/utils';
import MellowCard from '@/components/MellowCard'; import MellowCard from '@/components/MellowCard';
import styles from './index.less'; import styles from './index.less';
const FileList: React.FC = () => { interface FileListProps {
fileList: FileData[];
};
const FileList: React.FC<FileListProps> = ({
fileList = [],
}) => {
return ( return (
<MellowCard <MellowCard
title="相关不良原因举证附件" title="相关不良原因举证附件"
...@@ -18,21 +25,7 @@ const FileList: React.FC = () => { ...@@ -18,21 +25,7 @@ const FileList: React.FC = () => {
> >
<Upload <Upload
className={styles.file} className={styles.file}
fileList={[ fileList={fileList}
{
uid: '1',
name: 'xxx.png',
status: 'done',
response: 'Server Error 500', // custom error message to show
url: 'http://www.baidu.com/xxx.png',
},
{
uid: '2',
name: 'yyy.png',
status: 'done',
url: 'http://www.baidu.com/yyy.png',
},
]}
/> />
</MellowCard> </MellowCard>
); );
......
...@@ -22,6 +22,8 @@ interface HistoryListHistoryListProps { ...@@ -22,6 +22,8 @@ interface HistoryListHistoryListProps {
rowKey?: string; rowKey?: string;
// 目标路径 // 目标路径
target?: string; target?: string;
// loading
loading?: boolean;
}; };
const ProductList: React.FC<HistoryListHistoryListProps> = ({ const ProductList: React.FC<HistoryListHistoryListProps> = ({
...@@ -30,6 +32,7 @@ const ProductList: React.FC<HistoryListHistoryListProps> = ({ ...@@ -30,6 +32,7 @@ const ProductList: React.FC<HistoryListHistoryListProps> = ({
columns = [], columns = [],
rowKey = 'id', rowKey = 'id',
target, target,
loading = false,
}) => { }) => {
return ( return (
...@@ -40,7 +43,7 @@ const ProductList: React.FC<HistoryListHistoryListProps> = ({ ...@@ -40,7 +43,7 @@ const ProductList: React.FC<HistoryListHistoryListProps> = ({
rowKey={rowKey} rowKey={rowKey}
dataSource={dataSource} dataSource={dataSource}
columns={columns} columns={columns}
loading={false} loading={loading}
pagination={null} pagination={null}
/> />
</MellowCard> </MellowCard>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-03 13:53:58 * @Date: 2020-11-03 13:53:58
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-03 14:11:57 * @LastEditTime: 2020-11-16 17:59:26
* @Description: 维修地址 * @Description: 维修地址
*/ */
import React from 'react'; import React from 'react';
...@@ -10,7 +10,21 @@ import { Descriptions } from 'antd'; ...@@ -10,7 +10,21 @@ import { Descriptions } from 'antd';
import MellowCard from '@/components/MellowCard'; import MellowCard from '@/components/MellowCard';
import styles from './index.less'; import styles from './index.less';
const RepairAddressInfo: React.FC = () => { export interface RepairAddressInfoProps {
info: {
id: string;
// 收件人
receiverName: string;
// 电话
phone: string;
// 详细地址
fullAddress: string;
};
};
const RepairAddressInfo: React.FC<RepairAddressInfoProps> = ({
info = {},
}) => {
return ( return (
<MellowCard <MellowCard
title="维修地址" title="维修地址"
...@@ -18,8 +32,8 @@ const RepairAddressInfo: React.FC = () => { ...@@ -18,8 +32,8 @@ const RepairAddressInfo: React.FC = () => {
> >
<Descriptions column={1} className={styles.desc}> <Descriptions column={1} className={styles.desc}>
<Descriptions.Item label="维修地址"> <Descriptions.Item label="维修地址">
<p>张三 / 185 2929 6475</p> <p>{info.receiverName || ''} / {info.phone || ''}</p>
<p>广东省广州市海珠区新港东路1068号中洲中心北塔6楼</p> <p>{info.fullAddress || ''}</p>
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
</MellowCard> </MellowCard>
......
...@@ -2,26 +2,51 @@ ...@@ -2,26 +2,51 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-03 14:12:34 * @Date: 2020-11-03 14:12:34
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-03 17:48:20 * @LastEditTime: 2020-11-16 18:02:24
* @Description: 评价 * @Description: 评价
*/ */
import React from 'react'; import React from 'react';
import MellowCard from '@/components/MellowCard'; import MellowCard from '@/components/MellowCard';
import { Gauge } from '@/components/Charts'; import { Gauge } from '@/components/Charts';
const Score: React.FC = () => { // 满分 5分
const FULL_SCORE = 5;
const COLOR_MAP = {
0: '#EF6260',
1: '#EF6260',
2: '#FFC400',
3: '#6C9CEB',
4: '#41CC9E',
5: '#41CC9E',
};
const TITLE_MAP = {
0: '非常不满意',
1: '非常不满意',
2: '不满意',
3: '一般',
4: '满意',
5: '非常满意',
};
interface ScoreProps {
score: number;
};
const Score: React.FC<ScoreProps> = ({
score = 0,
}) => {
return ( return (
<MellowCard <MellowCard
title="售后评价" title="售后评价"
fullHeight fullHeight
> >
<Gauge <Gauge
title="5分" title={`${score}分`}
height={170} height={170}
percent={80} percent={+(score/FULL_SCORE).toFixed(2)}
formatter={() => ''} formatter={() => ''}
formatContent={(val) => `非常满意${val}`} formatContent={(val) => `${TITLE_MAP[score]}${val}`}
color="#41CC9E" color={COLOR_MAP[score]}
/> />
</MellowCard> </MellowCard>
); );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-10-28 17:29:14 * @Date: 2020-10-28 17:29:14
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-28 17:38:06 * @LastEditTime: 2020-11-16 18:28:40
* @Description: 提交审核 Modal * @Description: 提交审核 Modal
*/ */
import React from 'react'; import React from 'react';
...@@ -48,8 +48,8 @@ const VerifyModal: React.FC<VerifyModalProps> = ({ ...@@ -48,8 +48,8 @@ const VerifyModal: React.FC<VerifyModalProps> = ({
> >
<NiceForm <NiceForm
effects={($, { setFieldState }) => { effects={($, { setFieldState }) => {
onFieldValueChange$('agree').subscribe(fieldState => { onFieldValueChange$('isPass').subscribe(fieldState => {
setFieldState('reason', state => { setFieldState('opinion', state => {
state.visible = !fieldState.value; state.visible = !fieldState.value;
}); });
}); });
......
...@@ -14,9 +14,8 @@ import { FormOutlined } from '@ant-design/icons'; ...@@ -14,9 +14,8 @@ import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi'; import { history } from 'umi';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetAsRepairGoodsGetDetailByConsumerResponse } from '@/services/AfterServiceApi'; import { GetAsRepairGoodsGetDetailByConsumerResponse, GetAsRepairGoodsPageRepairGoodsResponse } from '@/services/AfterServiceApi';
import { CREDIT_INNER_STATUS, CREDIT_OUTER_STATUS, CREDIT_STATUS } from '@/constants'; import { normalizeFiledata, FileData, findLastIndexFlowState, isJSONStr } from '@/utils';
import { normalizeFiledata, FileData, findLastIndexFlowState } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap'; import AvatarWrap from '@/components/AvatarWrap';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
...@@ -44,14 +43,20 @@ interface DetailInfoProps { ...@@ -44,14 +43,20 @@ interface DetailInfoProps {
headExtra?: React.ReactNode; headExtra?: React.ReactNode;
}; };
interface DetailInfo extends GetAsRepairGoodsGetDetailByConsumerResponse {
fileList: FileData[];
};
const DetailInfo: React.FC<DetailInfoProps> = ({ const DetailInfo: React.FC<DetailInfoProps> = ({
id, id,
isEdit = false, isEdit = false,
target, target,
headExtra = null, headExtra = null,
}) => { }) => {
const [detailInfo, setDetailInfo] = useState<GetAsRepairGoodsGetDetailByConsumerResponse>(null); const [detailInfo, setDetailInfo] = useState<DetailInfo>(null);
const [repairGoodsList, setRepairGoodsList] = useState<GetAsRepairGoodsPageRepairGoodsResponse>({ data: [], totalCount: 0 });
const [infoLoading, setInfoLoading] = useState(false); const [infoLoading, setInfoLoading] = useState(false);
const [repairGoodsLoading, setRepairGoodsLoading] = useState(false);
const productColumns: EditableColumns[] = [ const productColumns: EditableColumns[] = [
{ {
...@@ -66,8 +71,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -66,8 +71,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
), ),
}, },
{ {
title: 'ID', title: '商品ID',
dataIndex: 'id', dataIndex: 'productId',
align: 'center', align: 'center',
}, },
{ {
...@@ -92,17 +97,17 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -92,17 +97,17 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
}, },
{ {
title: '采购数量', title: '采购数量',
dataIndex: 'quantity', dataIndex: 'purchaseCount',
align: 'center', align: 'center',
}, },
{ {
title: '维修数量', title: '维修数量',
dataIndex: 'num', dataIndex: 'repairCount',
align: 'center', align: 'center',
}, },
{ {
title: '维修原因', title: '维修原因',
dataIndex: 'reason', dataIndex: 'repairReason',
align: 'center', align: 'center',
}, },
]; ];
...@@ -117,15 +122,50 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -117,15 +122,50 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
repairId: id, repairId: id,
}).then(res => { }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setDetailInfo(res.data); const {
repairAddress,
faultFileList,
supplierName,
supplierMemberId,
supplierRoleId,
...rest
} = res.data;
setDetailInfo({
faultFileList,
supplierName,
...rest,
fileList: faultFileList.map(item => normalizeFiledata(item.filePath)),
repairAddress: isJSONStr(repairAddress) || null,
});
} }
}).finally(() => { }).finally(() => {
setInfoLoading(false); setInfoLoading(false);
}); });
}; };
// 获取维修明细列表
const getRepairGoods = () => {
if (!id) {
return;
}
setRepairGoodsLoading(true);
PublicApi.getAsRepairGoodsPageRepairGoods({
repairId: id,
current: `${1}`,
pageSize: `${99999}`,
}).then(res => {
if (res.code === 1000) {
setRepairGoodsList(res.data);
}
}).finally(() => {
setRepairGoodsLoading(false);
});
};
useEffect(() => { useEffect(() => {
getDetailInfo(); getDetailInfo();
getRepairGoods();
}, []); }, []);
return ( return (
...@@ -195,8 +235,10 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -195,8 +235,10 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<Suspense fallback={null}> <Suspense fallback={null}>
<ProductList <ProductList
title="维修商品" title="维修商品"
rowKey="orderRecordId"
columns={productColumns} columns={productColumns}
dataSource={[]} dataSource={repairGoodsList.data}
loading={repairGoodsLoading}
/> />
</Suspense> </Suspense>
</Col> </Col>
...@@ -208,19 +250,19 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -208,19 +250,19 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
> >
<Col span={6}> <Col span={6}>
<Suspense fallback={null}> <Suspense fallback={null}>
<FileList /> <FileList fileList={detailInfo?.fileList} />
</Suspense> </Suspense>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Suspense fallback={null}> <Suspense fallback={null}>
<RepairAddressInfo /> <RepairAddressInfo info={detailInfo && detailInfo.repairAddress ? detailInfo.repairAddress as any : {}} />
</Suspense> </Suspense>
</Col> </Col>
<Col span={6}> <Col span={6}>
<Suspense fallback={null}> <Suspense fallback={null}>
<Score /> <Score score={detailInfo?.evaluate?.level} />
</Suspense> </Suspense>
</Col> </Col>
</Row> </Row>
......
...@@ -45,7 +45,7 @@ const RepairPrFinished: React.FC = () => { ...@@ -45,7 +45,7 @@ const RepairPrFinished: React.FC = () => {
render: (text, record) => ( render: (text, record) => (
<> <>
<EyePreview <EyePreview
url={`/memberCenter/afterService/repairApplication/repairPrFinished/detail?id=${record.id}`} url={`/memberCenter/afterService/repairApplication/repairPrFinished/detail?id=${record.applyId}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -93,7 +93,7 @@ const RepairPrFinished: React.FC = () => { ...@@ -93,7 +93,7 @@ const RepairPrFinished: React.FC = () => {
<> <>
<Button <Button
type="link" type="link"
onClick={() => history.push(`/memberCenter/afterService/repairApplication/repairPrFinished/verify`)} onClick={() => history.push(`/memberCenter/afterService/repairApplication/repairPrFinished/verify?id=${record.applyId}`)}
> >
确认售后完成 确认售后完成
</Button> </Button>
...@@ -122,17 +122,6 @@ const RepairPrFinished: React.FC = () => { ...@@ -122,17 +122,6 @@ const RepairPrFinished: React.FC = () => {
reject(); reject();
}); });
}); });
// return Promise.resolve({
// data: [
// {
// id: 1,
// applyNo: '123',
// parentMemberName: '申请单摘要',
// created: '2020-11-03 11:46:00',
// },
// ],
// total: 10,
// });
}; };
// 初始化高级筛选选项 // 初始化高级筛选选项
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
&-body { &-body {
flex: 1; flex: 1;
overflow: auto;
} }
&-foot { &-foot {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-04 15:09:09 * @Date: 2020-11-04 15:09:09
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-13 15:54:18 * @LastEditTime: 2020-11-16 16:22:36
* @Description: 维修商品抽屉组件 * @Description: 维修商品抽屉组件
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -68,12 +68,16 @@ export interface OrderListRes { ...@@ -68,12 +68,16 @@ export interface OrderListRes {
}; };
interface GoodsDrawerProps { interface GoodsDrawerProps {
// 选中值(子表格的值)
checked: number[];
// 是否可见的 // 是否可见的
visible: boolean; visible: boolean;
// 关闭事件 // 关闭事件
onClose: () => void; onClose: () => void;
// 确定事件 // 确定事件
onConfirm: (values: goodItem[]) => void; onConfirm: (values: goodItem[]) => void;
// 选项改变事件
onChange: (value: number[]) => void;
// 获取订单列表数据 // 获取订单列表数据
fetchOrderList: (params: any) => Promise<OrderListRes>; fetchOrderList: (params: any) => Promise<OrderListRes>;
}; };
...@@ -94,7 +98,51 @@ interface GoodsDrawerState { ...@@ -94,7 +98,51 @@ interface GoodsDrawerState {
loading: boolean; loading: boolean;
}; };
// 跟 选中的子节点 找到 父级选中的 keys
function transformParentKeys(data: any[], childCheckedKeys: string[]) {
const ret = [];
if (!Array.isArray(data)) {
return ret;
}
data.forEach(item => {
const atom = {
checkeds: [],
...item,
};
// 这里循环遍历 判断 选中的子表格的keys中 是否包含 当前子项,如果有先 push 到父节点的 checkeds
if (item.productDateilss && item.productDateilss.length) {
item.productDateilss.forEach(childItem => {
if (childCheckedKeys.find(key => key === childItem.id)) {
atom.checkeds.push(childItem.id);
}
});
}
// 判断两者长度 一样 就表示父节点时候选中的
if (atom.checkeds.length === atom.productDateilss.length) {
ret.push(atom.id);
}
});
return ret;
};
class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
static getDerivedStateFromProps(nextProps, nextState) {
const { checked } = nextProps;
const { dataSource } = nextState;
const parents = transformParentKeys(dataSource.data, checked);
if ('checked' in nextProps) {
return {
selectedRowKeys: parents,
childSelectedRowKeys: checked,
};
}
return null;
}
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
...@@ -243,22 +291,9 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { ...@@ -243,22 +291,9 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
} }
}; };
handleSetChildSelectedRowKeys = keys => {
this.setState({
childSelectedRowKeys: keys,
});
};
handleSetSelectedRowKeys = keys => {
this.setState({
selectedRowKeys: keys,
});
};
// 子表格选中行 // 子表格选中行
handleChildSelectChange = (record: any, selected: any, selectedRows: any) => { handleChildSelectChange = (record: any, selected: any, selectedRows: any) => {
const { const {
selectedRowKeys,
childSelectedRowKeys, childSelectedRowKeys,
dataSource: { dataSource: {
data, data,
...@@ -271,24 +306,11 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { ...@@ -271,24 +306,11 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
} else { } else {
childArr.splice(childArr.findIndex((item: any) => item === record.id), 1); childArr.splice(childArr.findIndex((item: any) => item === record.id), 1);
} }
  // 必须去除undefined,否则selectedRows会将其他子Table中选中的 id值 放到数组中,但是值为undefined,如:[ undefined,1,uundefined]
selectedRows = selectedRows.filter((a: any) => a !== undefined); if (!('checked' in this.props)) {
// 第二步,判断selectedRows的长度是否为data中child的长度,相等,就将父table选中,不等就不选中 this.setState({ childSelectedRowKeys: childArr });
for (let item of data) {
if (item.productDateilss.find((d: any) => d.id === record.id)) {
let parentArr: any = [...selectedRowKeys];
if (item.productDateilss.length === selectedRows.length) {
parentArr.push(item.id);
} else {
if (parentArr.length && parentArr.find((d: any) => d === item.id)) {
parentArr.splice(parentArr.findIndex((item1: any) => item1 === item.id), 1);
}
}
this.handleSetSelectedRowKeys(parentArr);
break;
}
} }
this.handleSetChildSelectedRowKeys(childArr); this.triggerChange(childArr);
}; };
// 子表格选中所有行 // 子表格选中所有行
...@@ -309,22 +331,10 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { ...@@ -309,22 +331,10 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
// 取消全选 // 取消全选
childArr = childArr.filter((item: any) => !changeRows.some((e: any) => e.id === item)); childArr = childArr.filter((item: any) => !changeRows.some((e: any) => e.id === item));
} }
// 第二步:找到子Table对应的父Table的所在行,再判断selected,true:将父Table所在行选中,false:将父Table所在行取消选中 if (!('checked' in this.props)) {
for (let item of data) { this.setState({ childSelectedRowKeys: childArr });
if (item.productDateilss.find((d: any) => d.id === changeRows[0].id)) {
let parentArr: any = [...selectedRowKeys];
if (selected) {
// 全选
parentArr.push(item.id);
} else {
// 取消全选
parentArr.splice(parentArr.findIndex((item: any) => item === item.id), 1);
}
this.handleSetSelectedRowKeys(parentArr);
break;
}
} }
this.handleSetChildSelectedRowKeys(childArr); this.triggerChange(childArr);
}; };
// 表格选中行 // 表格选中行
...@@ -336,23 +346,22 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { ...@@ -336,23 +346,22 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
data, data,
}, },
} = this.state; } = this.state;
let parentArr: any = [...selectedRowKeys];
let childArr: any = [...childSelectedRowKeys]; let childArr: any = [...childSelectedRowKeys];
// setChildArr:选择父Table下的所有子选项 // setChildArr:选择父Table下的所有子选项
let setChildArr = data.find((d: any) => d.id === record.id).productDateilss.map((item: any) => item.id); let setChildArr = data.find((d: any) => d.id === record.id).productDateilss.map((item: any) => item.id);
// 第一步 判断selected true:选中,false,取消选中 // 第一步 判断selected true:选中,false,取消选中
if (selected) { if (selected) {
// 第二步,父Table选中,子Table全选中(全部整合到一起,然后去重) // 第二步,父Table选中,子Table全选中(全部整合到一起,然后去重)
parentArr.push(record.id);
childArr = Array.from(new Set([...setChildArr, ...childArr])); childArr = Array.from(new Set([...setChildArr, ...childArr]));
} else { } else {
// 第二步,父Table取消选中,子Table全取消选中(针对childArr,过滤掉取消选中的父Table下的所有子Table的 id) // 第二步,父Table取消选中,子Table全取消选中(针对childArr,过滤掉取消选中的父Table下的所有子Table的 id)
parentArr.splice(parentArr.findIndex((item: any) => item === record.id), 1);
childArr = childArr.filter((item: any) => !setChildArr.some((e: any) => e === item)); childArr = childArr.filter((item: any) => !setChildArr.some((e: any) => e === item));
} }
// 第三步,设置父,子的SelectedRowKeys
this.handleSetSelectedRowKeys(parentArr); if (!('checked' in this.props)) {
this.handleSetChildSelectedRowKeys(childArr); this.setState({ childSelectedRowKeys: childArr });
}
this.triggerChange(childArr);
}; };
// 表格选中所有行 // 表格选中所有行
...@@ -364,24 +373,25 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { ...@@ -364,24 +373,25 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
data, data,
}, },
} = this.state; } = this.state;
let parentArr: any = [...selectedRowKeys];
let setChildArr: any = []; let setChildArr: any = [];
  // 将改变的父Table下的子Table下的 id 都添加到setChildArr中   // 将改变的父Table下的子Table下的 id 都添加到setChildArr中
changeRows.forEach((item: any) => { data.forEach((item: any) => {
setChildArr = [...setChildArr, ...item.productDateilss.map((item: any) => item.id)]; setChildArr = [...setChildArr, ...item.productDateilss.map((item: any) => item.id)];
}); });
// 第一步判断 selected true:全选,false:取消全选 // 第一步判断 selected true:全选,false:取消全选
if (selected) { if (selected) {
// 第二步:父Table选中,子Table全选中,设置子Table 的 SelectedRowKeys // 第二步:父Table选中,子Table全选中,设置子Table 的 SelectedRowKeys
parentArr = Array.from(new Set([...parentArr, ...changeRows.map((item: any) => item.id)])); if (!('checked' in this.props)) {
this.handleSetChildSelectedRowKeys(setChildArr); this.setState({ childSelectedRowKeys: setChildArr });
}
this.triggerChange(setChildArr);
} else { } else {
// 第二步:父Table取消选中,子Table 全取消选中,设置子 Table 的 SelectedRowKeys // 第二步:父Table取消选中,子Table 全取消选中,设置子 Table 的 SelectedRowKeys
parentArr = parentArr.filter((item: any) => !changeRows.some((e: any) => e.id === item)); if (!('checked' in this.props)) {
this.handleSetChildSelectedRowKeys([]); this.setState({ childSelectedRowKeys: [] });
}
this.triggerChange([]);
} }
// 第三步:设置父Table的SelectedRowKeys
this.handleSetSelectedRowKeys(parentArr);
}; };
handleConfirm = () => { handleConfirm = () => {
...@@ -411,6 +421,20 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { ...@@ -411,6 +421,20 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
this.handleClose(); this.handleClose();
}; };
handleAfterVisibleChange = visible => {
console.log('visible', visible)
if (!visible) {
this.handleClose();
}
};
triggerChange = changedValue => {
const { onChange } = this.props;
if (onChange) {
onChange(changedValue);
}
};
render() { render() {
const { const {
page, page,
...@@ -428,7 +452,8 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { ...@@ -428,7 +452,8 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
<Drawer <Drawer
title="选择维修商品" title="选择维修商品"
width={1200} width={1200}
onClose={this.handleClose} // onClose={this.handleClose}
afterVisibleChange={this.handleAfterVisibleChange}
visible={visible} visible={visible}
footer={ footer={
<div <div
...@@ -479,7 +504,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> { ...@@ -479,7 +504,7 @@ class GoodsDrawer extends React.Component<GoodsDrawerProps, GoodsDrawerState> {
rowSelection={{ rowSelection={{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onSelect: this.handleParentSelectChange, onSelect: this.handleParentSelectChange,
onSelectAll: this.hanldeParentSelectAll, onSelectAll: this.hanldeParentSelectAll,
}} }}
/> />
</div> </div>
......
...@@ -8,6 +8,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'; ...@@ -8,6 +8,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined, PlusOutlined } from '@ant-design/icons'; import { SaveOutlined, PlusOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd'; import { createFormActions, FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetAsRepairGoodsPageRepairGoodsResponse } from '@/services/AfterServiceApi';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils'; import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
...@@ -30,7 +31,11 @@ interface DetailInfo { ...@@ -30,7 +31,11 @@ interface DetailInfo {
applyTime: string; applyTime: string;
faultFileList?: FileData[]; faultFileList?: FileData[];
repairAddress?: { [key: string]: any }[]; repairAddress?: { [key: string]: any }[];
supplierMember?: {}, supplierMember?: {},
outerStatus?: number,
outerStatusName?: string,
innerStatus?: number,
innerStatusName?: string,
} }
interface BillsFormProps { interface BillsFormProps {
...@@ -46,14 +51,14 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -46,14 +51,14 @@ const RepairForm: React.FC<BillsFormProps> = ({
const [detailInfo, setDetailInfo] = useState<DetailInfo>({ const [detailInfo, setDetailInfo] = useState<DetailInfo>({
applyTime: moment().format('YYYY-MM-DD HH:mm:ss'), applyTime: moment().format('YYYY-MM-DD HH:mm:ss'),
}); });
const [visible, setVisible] = useState(false); const [repairGoodsList, setRepairGoodsList] = useState<GetAsRepairGoodsPageRepairGoodsResponse>({ data: [], totalCount: 0 });
const [unsaved, setUnsaved] = useState(false); const [unsaved, setUnsaved] = useState(false);
const [infoLoading, setInfoLoading] = useState(false); const [infoLoading, setInfoLoading] = useState(false);
const [repairGoodsLoading, setRepairGoodsLoading] = useState(false);
const [goodsValue, setGoodsValue] = useState([]);
const [submitLoading, setSubmitLoading] = useState(false); const [submitLoading, setSubmitLoading] = useState(false);
const [visibleDrawer, setVisibleDrawer] = useState(false); const [visibleDrawer, setVisibleDrawer] = useState(false);
const goodsDrawerRef = useRef(null);
// 获取维修申请详情 // 获取维修申请详情
const getDetailInfo = () => { const getDetailInfo = () => {
if (!id) { if (!id) {
...@@ -68,6 +73,8 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -68,6 +73,8 @@ const RepairForm: React.FC<BillsFormProps> = ({
repairAddress, repairAddress,
faultFileList, faultFileList,
supplierName, supplierName,
supplierMemberId,
supplierRoleId,
...rest ...rest
} = res.data; } = res.data;
...@@ -79,6 +86,7 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -79,6 +86,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
); );
setDetailInfo({ setDetailInfo({
...detailInfo,
faultFileList: faultFileList.map(item => normalizeFiledata(item.filePath)), faultFileList: faultFileList.map(item => normalizeFiledata(item.filePath)),
repairAddress: isJSONStr(repairAddress) || null, repairAddress: isJSONStr(repairAddress) || null,
supplierMember: supplierMember:
...@@ -86,6 +94,8 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -86,6 +94,8 @@ const RepairForm: React.FC<BillsFormProps> = ({
[ [
{ {
name: supplierName, name: supplierName,
memberId: supplierMemberId,
roleId: supplierRoleId,
}, },
] : ] :
[] []
...@@ -98,6 +108,26 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -98,6 +108,26 @@ const RepairForm: React.FC<BillsFormProps> = ({
}); });
}; };
// 获取维修明细列表
const getRepairGoods = () => {
if (!id) {
return;
}
setRepairGoodsLoading(true);
PublicApi.getAsRepairGoodsPageRepairGoods({
repairId: id,
current: `${1}`,
pageSize: `${99999}`,
}).then(res => {
if (res.code === 1000) {
setRepairGoodsList(res.data);
setGoodsValue(res.data && res.data.data ? res.data.data.map(item => item.orderRecordId) : []);
}
}).finally(() => {
setRepairGoodsLoading(false);
});
};
// 根据供应会员获取订单列表 // 根据供应会员获取订单列表
const getOrderList = (params): Promise<OrderListRes> => { const getOrderList = (params): Promise<OrderListRes> => {
const supplierMemberValue = addSchemaAction.getFieldValue('supplierMember'); const supplierMemberValue = addSchemaAction.getFieldValue('supplierMember');
...@@ -120,6 +150,7 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -120,6 +150,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
useEffect(() => { useEffect(() => {
getDetailInfo(); getDetailInfo();
getRepairGoods();
}, []); }, []);
const handleAddGoods = () => { const handleAddGoods = () => {
...@@ -153,9 +184,6 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -153,9 +184,6 @@ const RepairForm: React.FC<BillsFormProps> = ({
...rest ...rest
} = values; } = values;
console.log('values', values)
return;
setSubmitLoading(true); setSubmitLoading(true);
const payload = { const payload = {
repairId: id || 0, // 有 id 表示编辑,0表示新增 repairId: id || 0, // 有 id 表示编辑,0表示新增
...@@ -174,6 +202,7 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -174,6 +202,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
unit, unit,
...rest ...rest
}) => ({ }) => ({
orderRecordId: id,
repairCount: +repairCount, repairCount: +repairCount,
brand: brand || '', brand: brand || '',
unit: unit || '', unit: unit || '',
...@@ -195,22 +224,15 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -195,22 +224,15 @@ const RepairForm: React.FC<BillsFormProps> = ({
}); });
}; };
// 删除维修商品项
const handleRemoveItem = (index: number) => { const handleRemoveItem = (index: number) => {
const { childSelectedRowKeys } = goodsDrawerRef.current.state; const newGoodsValue = [...goodsValue];
const newValue = [...addSchemaAction.getFieldValue('repairGoodsList')];
goodsDrawerRef.current.handleSetChildSelectedRowKeys([]);
// do something
// const newSelectRow = [...productRowCtl.selectRow];
// const newSelectedRowKeys = [...productRowCtl.selectedRowKeys];
// const newValue = [...addSchemaAction.getFieldValue('invoicesDetailsRequests')];
// newSelectRow.splice(index, 1); const deleted = newValue.splice(index, 1);
// newSelectedRowKeys.splice(index, 1); addSchemaAction.setFieldValue('repairGoodsList', newValue);
// productRowCtl.setSelectRow(newSelectRow); newGoodsValue.splice(newGoodsValue.findIndex(item => item === deleted[0].id), 1);
// productRowCtl.setSelectedRowKeys(newSelectedRowKeys); setGoodsValue(newGoodsValue);
// newValue.splice(index, 1);
// addSchemaAction.setFieldValue('invoicesDetailsRequests', newValue);
}; };
// ArrayTable自定义渲染 // ArrayTable自定义渲染
...@@ -255,6 +277,10 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -255,6 +277,10 @@ const RepairForm: React.FC<BillsFormProps> = ({
addSchemaAction.setFieldValue('repairGoodsList', value); addSchemaAction.setFieldValue('repairGoodsList', value);
}; };
const handleGoodsChange = values => {
setGoodsValue(values);
};
const OuterStatus = ( const OuterStatus = (
<StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[detailInfo?.outerStatus]} title={detailInfo?.outerStatusName} /> <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[detailInfo?.outerStatus]} title={detailInfo?.outerStatusName} />
); );
...@@ -264,7 +290,7 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -264,7 +290,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
); );
return ( return (
<Spin spinning={infoLoading}> <Spin spinning={infoLoading || repairGoodsLoading}>
<PageHeaderWrapper <PageHeaderWrapper
style={{ style={{
padding: 24, padding: 24,
...@@ -296,7 +322,10 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -296,7 +322,10 @@ const RepairForm: React.FC<BillsFormProps> = ({
> >
<Card> <Card>
<NiceForm <NiceForm
initialValues={detailInfo} initialValues={{
...detailInfo,
repairGoodsList: repairGoodsList.data,
}}
expressionScope={{ expressionScope={{
TableAddButton, TableAddButton,
OuterStatus, OuterStatus,
...@@ -328,7 +357,8 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -328,7 +357,8 @@ const RepairForm: React.FC<BillsFormProps> = ({
fetchOrderList={getOrderList} fetchOrderList={getOrderList}
onClose={() => setVisibleDrawer(false)} onClose={() => setVisibleDrawer(false)}
onConfirm={handleGoodsConfirm} onConfirm={handleGoodsConfirm}
ref={goodsDrawerRef} checked={goodsValue}
onChange={handleGoodsChange}
/> />
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" /> <Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
......
...@@ -6,6 +6,7 @@ import { ...@@ -6,6 +6,7 @@ import {
Button, Button,
Popconfirm, Popconfirm,
Space, Space,
message,
} from 'antd'; } from 'antd';
import { history } from 'umi'; import { history } from 'umi';
import { import {
...@@ -25,11 +26,15 @@ import { coverColFiltersItem } from '@/utils'; ...@@ -25,11 +26,15 @@ import { coverColFiltersItem } from '@/utils';
import EyePreview from '@/components/EyePreview'; import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import { listSearchSchema } from './schema'; import {
REPAIR_INNER_STATUS_UNCOMMITTED,
REPAIR_OUTER_STATUS_FAILED,
} from '@/constants';
import { import {
REPAIR_OUTER_STATUS_TAG_MAP, REPAIR_OUTER_STATUS_TAG_MAP,
REPAIR_INNER_STATUS_BADGE_MAP, REPAIR_INNER_STATUS_BADGE_MAP,
} from '../../constants'; } from '../../constants';
import { listSearchSchema } from './schema';
import styles from './index.less'; import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
...@@ -37,6 +42,38 @@ const formActions = createFormActions(); ...@@ -37,6 +42,38 @@ const formActions = createFormActions();
const RepairPrSubmit: React.FC = () => { const RepairPrSubmit: React.FC = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const handleDelete = record => {
const msg = message.loading({
content: '正在删除',
duration: 0,
});
PublicApi.postAsRepairGoodsDelete({
dataId: record.applyId,
}).then(res => {
if (res.code === 1000) {
ref.current.reload();
}
}).finally(() => {
msg();
});
};
const handleSubmit = record => {
const msg = message.loading({
content: '正在提交',
duration: 0,
});
PublicApi.postAsRepairGoodsSubmit({
dataId: record.applyId,
}).then(res => {
if (res.code === 1000) {
ref.current.reload();
}
}).finally(() => {
msg();
});
};
const defaultColumns: ColumnType<any>[] = [ const defaultColumns: ColumnType<any>[] = [
{ {
title: '申请单号', title: '申请单号',
...@@ -45,7 +82,7 @@ const RepairPrSubmit: React.FC = () => { ...@@ -45,7 +82,7 @@ const RepairPrSubmit: React.FC = () => {
render: (text, record) => ( render: (text, record) => (
<> <>
<EyePreview <EyePreview
url={`/memberCenter/afterService/repairApplication/repairPrSubmit/detail?id=${record.id}`} url={`/memberCenter/afterService/repairApplication/repairPrSubmit/detail?id=${record.applyId}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -91,31 +128,41 @@ const RepairPrSubmit: React.FC = () => { ...@@ -91,31 +128,41 @@ const RepairPrSubmit: React.FC = () => {
align: 'center', align: 'center',
render: (text, record) => ( render: (text, record) => (
<> <>
<Button {record.outerStatus === REPAIR_INNER_STATUS_UNCOMMITTED && (
type="link" <Button
onClick={() => {}}
>
提交
</Button>
<Popconfirm
title="确定要删除吗?"
okText="是"
cancelText="否"
onConfirm={() => {}}
>
<Button
type="link" type="link"
danger onClick={() => handleSubmit(record)}
> >
删除 提交
</Button> </Button>
</Popconfirm> )}
<Button {record.outerStatus === REPAIR_INNER_STATUS_UNCOMMITTED && (
type="link" <Popconfirm
onClick={() => history.push(`/memberCenter/afterService/repairApplication/repairPrSubmit/edit?id=${record.applyId}`)} title="确定要删除吗?"
> okText="是"
编辑 cancelText="否"
</Button> onConfirm={() => handleDelete(record)}
>
<Button
type="link"
danger
>
删除
</Button>
</Popconfirm>
)}
{/* 外部状态为不接受申请 或者 内部状态为 待提交申请 都可以进行编辑 */}
{(
record.outerStatus === REPAIR_OUTER_STATUS_FAILED ||
record.innerStatus === REPAIR_INNER_STATUS_UNCOMMITTED
) && (
<Button
type="link"
onClick={() => history.push(`/memberCenter/afterService/repairApplication/repairPrSubmit/edit?id=${record.applyId}`)}
>
编辑
</Button>
)}
</> </>
), ),
}, },
...@@ -141,17 +188,6 @@ const RepairPrSubmit: React.FC = () => { ...@@ -141,17 +188,6 @@ const RepairPrSubmit: React.FC = () => {
reject(); reject();
}); });
}); });
// return Promise.resolve({
// data: [
// {
// id: 1,
// applyNo: '123',
// parentMemberName: '申请单摘要',
// created: '2020-11-03 11:46:00',
// },
// ],
// total: 10,
// });
}; };
// 初始化高级筛选选项 // 初始化高级筛选选项
......
...@@ -14,9 +14,8 @@ import { FormOutlined } from '@ant-design/icons'; ...@@ -14,9 +14,8 @@ import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi'; import { history } from 'umi';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetAsRepairGoodsGetDetailBySupplierResponse } from '@/services/AfterServiceApi'; import { GetAsRepairGoodsGetDetailBySupplierResponse, GetAsRepairGoodsPageRepairGoodsResponse } from '@/services/AfterServiceApi';
import { CREDIT_INNER_STATUS, CREDIT_OUTER_STATUS, CREDIT_STATUS } from '@/constants'; import { normalizeFiledata, FileData, findLastIndexFlowState, isJSONStr } from '@/utils';
import { normalizeFiledata, FileData, findLastIndexFlowState } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap'; import AvatarWrap from '@/components/AvatarWrap';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import AuditProcess from '@/components/AuditProcess'; import AuditProcess from '@/components/AuditProcess';
...@@ -44,14 +43,20 @@ interface DetailInfoProps { ...@@ -44,14 +43,20 @@ interface DetailInfoProps {
headExtra?: React.ReactNode; headExtra?: React.ReactNode;
}; };
interface DetailInfo extends GetAsRepairGoodsGetDetailBySupplierResponse {
fileList: FileData[];
};
const DetailInfo: React.FC<DetailInfoProps> = ({ const DetailInfo: React.FC<DetailInfoProps> = ({
id, id,
isEdit = false, isEdit = false,
target, target,
headExtra = null, headExtra = null,
}) => { }) => {
const [detailInfo, setDetailInfo] = useState<GetAsRepairGoodsGetDetailBySupplierResponse>(null); const [detailInfo, setDetailInfo] = useState<DetailInfo>(null);
const [infoLoading, setInfoloading] = useState(false); const [repairGoodsList, setRepairGoodsList] = useState<GetAsRepairGoodsPageRepairGoodsResponse>({ data: [], totalCount: 0 });
const [infoLoading, setInfoLoading] = useState(false);
const [repairGoodsLoading, setRepairGoodsLoading] = useState(false);
const productColumns: EditableColumns[] = [ const productColumns: EditableColumns[] = [
{ {
...@@ -66,8 +71,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -66,8 +71,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
), ),
}, },
{ {
title: 'ID', title: '商品ID',
dataIndex: 'id', dataIndex: 'productId',
align: 'center', align: 'center',
}, },
{ {
...@@ -92,17 +97,17 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -92,17 +97,17 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
}, },
{ {
title: '采购数量', title: '采购数量',
dataIndex: 'quantity', dataIndex: 'purchaseCount',
align: 'center', align: 'center',
}, },
{ {
title: '维修数量', title: '维修数量',
dataIndex: 'num', dataIndex: 'repairCount',
align: 'center', align: 'center',
}, },
{ {
title: '维修原因', title: '维修原因',
dataIndex: 'reason', dataIndex: 'repairReason',
align: 'center', align: 'center',
}, },
]; ];
...@@ -112,20 +117,53 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -112,20 +117,53 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
if (!id) { if (!id) {
return; return;
} }
setInfoloading(true); setInfoLoading(true);
PublicApi.getAsRepairGoodsGetDetailBySupplier({ PublicApi.getAsRepairGoodsGetDetailBySupplier({
repairId: id, repairId: id,
}).then(res => { }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
setDetailInfo(res.data); const {
repairAddress,
faultFileList,
supplierName,
...rest
} = res.data;
setDetailInfo({
faultFileList,
supplierName,
...rest,
fileList: faultFileList.map(item => normalizeFiledata(item.filePath)),
repairAddress: isJSONStr(repairAddress) || null,
});
}
}).finally(() => {
setInfoLoading(false);
});
};
// 获取维修明细列表
const getRepairGoods = () => {
if (!id) {
return;
}
setRepairGoodsLoading(true);
PublicApi.getAsRepairGoodsPageRepairGoods({
repairId: id,
current: `${1}`,
pageSize: `${99999}`,
}).then(res => {
if (res.code === 1000) {
setRepairGoodsList(res.data);
} }
}).finally(() => { }).finally(() => {
setInfoloading(false); setRepairGoodsLoading(false);
}); });
}; };
useEffect(() => { useEffect(() => {
getDetailInfo(); getDetailInfo();
getRepairGoods();
}, []); }, []);
return ( return (
...@@ -208,8 +246,10 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -208,8 +246,10 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<Suspense fallback={null}> <Suspense fallback={null}>
<ProductList <ProductList
title="维修商品" title="维修商品"
rowKey="orderRecordId"
columns={productColumns} columns={productColumns}
dataSource={[]} dataSource={repairGoodsList.data}
loading={repairGoodsLoading}
/> />
</Suspense> </Suspense>
</Col> </Col>
...@@ -221,19 +261,19 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -221,19 +261,19 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
> >
<Col span={6}> <Col span={6}>
<Suspense fallback={null}> <Suspense fallback={null}>
<FileList /> <FileList fileList={detailInfo?.fileList} />
</Suspense> </Suspense>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Suspense fallback={null}> <Suspense fallback={null}>
<RepairAddressInfo /> <RepairAddressInfo info={detailInfo && detailInfo.repairAddress ? detailInfo.repairAddress as any : {}} />
</Suspense> </Suspense>
</Col> </Col>
<Col span={6}> <Col span={6}>
<Suspense fallback={null}> <Suspense fallback={null}>
<Score /> <Score score={detailInfo?.evaluate?.level} />
</Suspense> </Suspense>
</Col> </Col>
</Row> </Row>
......
...@@ -37,7 +37,7 @@ const RepairPr1: React.FC = () => { ...@@ -37,7 +37,7 @@ const RepairPr1: React.FC = () => {
render: (text, record) => ( render: (text, record) => (
<> <>
<EyePreview <EyePreview
url={`/memberCenter/afterService/repairManage/repairPr1/detail?id=${record.id}`} url={`/memberCenter/afterService/repairManage/repairPr1/detail?id=${record.applyId}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -85,7 +85,7 @@ const RepairPr1: React.FC = () => { ...@@ -85,7 +85,7 @@ const RepairPr1: React.FC = () => {
<> <>
<Button <Button
type="link" type="link"
onClick={() => history.push(`/memberCenter/afterService/repairManage/repairPr1/verify?id=${record.id}`)} onClick={() => history.push(`/memberCenter/afterService/repairManage/repairPr1/verify?id=${record.applyId}`)}
> >
提交审核 提交审核
</Button> </Button>
...@@ -114,17 +114,6 @@ const RepairPr1: React.FC = () => { ...@@ -114,17 +114,6 @@ const RepairPr1: React.FC = () => {
reject(); reject();
}); });
}); });
// return Promise.resolve({
// data: [
// {
// id: 1,
// applyNo: '123',
// parentMemberName: '申请单摘要',
// created: '2020-11-03 11:46:00',
// },
// ],
// total: 10,
// });
}; };
// 初始化高级筛选选项 // 初始化高级筛选选项
......
...@@ -37,7 +37,7 @@ const RepairPr2: React.FC = () => { ...@@ -37,7 +37,7 @@ const RepairPr2: React.FC = () => {
render: (text, record) => ( render: (text, record) => (
<> <>
<EyePreview <EyePreview
url={`/memberCenter/afterService/repairManage/repairPr2/detail?id=${record.id}`} url={`/memberCenter/afterService/repairManage/repairPr2/detail?id=${record.applyId}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -85,7 +85,7 @@ const RepairPr2: React.FC = () => { ...@@ -85,7 +85,7 @@ const RepairPr2: React.FC = () => {
<> <>
<Button <Button
type="link" type="link"
onClick={() => history.push(`/memberCenter/afterService/repairManage/repairPr2/verify?id=${record.id}`)} onClick={() => history.push(`/memberCenter/afterService/repairManage/repairPr2/verify?id=${record.applyId}`)}
> >
提交审核 提交审核
</Button> </Button>
......
...@@ -37,7 +37,7 @@ const RepairPrConfirm: React.FC = () => { ...@@ -37,7 +37,7 @@ const RepairPrConfirm: React.FC = () => {
render: (text, record) => ( render: (text, record) => (
<> <>
<EyePreview <EyePreview
url={`/memberCenter/afterService/repairManage/repairPrConfirm/detail?id=${record.id}`} url={`/memberCenter/afterService/repairManage/repairPrConfirm/detail?id=${record.applyId}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -46,17 +46,17 @@ const RepairPrConfirm: React.FC = () => { ...@@ -46,17 +46,17 @@ const RepairPrConfirm: React.FC = () => {
}, },
{ {
title: '申请单摘要', title: '申请单摘要',
dataIndex: 'parentMemberName', dataIndex: 'applyAbstract',
align: 'center', align: 'center',
}, },
{ {
title: '采购会员', title: '采购会员',
dataIndex: 'purchaser', dataIndex: 'consumerName',
align: 'center', align: 'center',
}, },
{ {
title: '单据时间', title: '单据时间',
dataIndex: 'created', dataIndex: 'applyTime',
align: 'center', align: 'center',
}, },
{ {
...@@ -85,7 +85,7 @@ const RepairPrConfirm: React.FC = () => { ...@@ -85,7 +85,7 @@ const RepairPrConfirm: React.FC = () => {
<> <>
<Button <Button
type="link" type="link"
onClick={() => history.push(`/memberCenter/afterService/repairManage/repairPrConfirm/verify?id=${record.id}`)} onClick={() => history.push(`/memberCenter/afterService/repairManage/repairPrConfirm/verify?id=${record.applyId}`)}
> >
提交审核 提交审核
</Button> </Button>
......
...@@ -37,7 +37,7 @@ const RepairPrSubmit: React.FC = () => { ...@@ -37,7 +37,7 @@ const RepairPrSubmit: React.FC = () => {
render: (text, record) => ( render: (text, record) => (
<> <>
<EyePreview <EyePreview
url={`/memberCenter/afterService/repairManage/repairPrSubmit/detail?id=${record.id}`} url={`/memberCenter/afterService/repairManage/repairPrSubmit/detail?id=${record.applyId}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -85,7 +85,7 @@ const RepairPrSubmit: React.FC = () => { ...@@ -85,7 +85,7 @@ const RepairPrSubmit: React.FC = () => {
<> <>
<Button <Button
type="link" type="link"
onClick={() => history.push(`/memberCenter/afterService/repairManage/repairPrSubmit/verify?id=${record.id}`)} onClick={() => history.push(`/memberCenter/afterService/repairManage/repairPrSubmit/verify?id=${record.applyId}`)}
> >
提交审核 提交审核
</Button> </Button>
...@@ -114,17 +114,6 @@ const RepairPrSubmit: React.FC = () => { ...@@ -114,17 +114,6 @@ const RepairPrSubmit: React.FC = () => {
reject(); reject();
}); });
}); });
// return Promise.resolve({
// data: [
// {
// id: 1,
// applyNo: '123',
// parentMemberName: '申请单摘要',
// created: '2020-11-03 11:46:00',
// },
// ],
// total: 10,
// });
}; };
// 初始化高级筛选选项 // 初始化高级筛选选项
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment