Commit 020a6280 authored by XieZhiXiong's avatar XieZhiXiong

Merge branch 'dev' into test

parents 699bd636 188b5f40
...@@ -63,7 +63,9 @@ const Relevance = props => { ...@@ -63,7 +63,9 @@ const Relevance = props => {
const keys = rows.map(item => item[tableRowKey]); const keys = rows.map(item => item[tableRowKey]);
if (props.mutators) { if (props.mutators) {
if (rows && rows.length) {
props.mutators.change(rows); props.mutators.change(rows);
}
setVisible(false); setVisible(false);
return; return;
} }
......
...@@ -987,3 +987,37 @@ export const CREDIT_OUTER_STATUS = { ...@@ -987,3 +987,37 @@ export const CREDIT_OUTER_STATUS = {
[CREDIT_OUTER_STATUS_SUCCESS]: '接受申请', [CREDIT_OUTER_STATUS_SUCCESS]: '接受申请',
[CREDIT_OUTER_STATUS_FAILED]: '不接受申请', [CREDIT_OUTER_STATUS_FAILED]: '不接受申请',
}; };
// 售后维修申请内部状态
export const REPAIR_INNER_STATUS_UNCOMMITTED = 1; // 待提交维修
export const REPAIR_INNER_STATUS_COMMITTED = 2; // 已提交
export const REPAIR_INNER_STATUS_SUCCESS_1 = 3; // 一级审核通过
export const REPAIR_INNER_STATUS_SUCCESS_2 = 4; // 二级审核通过
export const REPAIR_INNER_STATUS_FAILED = 5; // 审核不通过(不接受申请)
export const REPAIR_INNER_STATUS_CONFIRM_SUCCESS = 6; // 确认审核通过
export const REPAIR_INNER_STATUS_CONFIRM_FAILED = 7; // 确认审核不通过
export const REPAIR_INNER_STATUS_FINISHED = 8; // 确认售后完成
export const REPAIR_INNER_STATUS = {
[REPAIR_INNER_STATUS_UNCOMMITTED]: '待提交',
[REPAIR_INNER_STATUS_COMMITTED]: '已提交',
[REPAIR_INNER_STATUS_SUCCESS_1]: '一级审核通过',
[REPAIR_INNER_STATUS_SUCCESS_2]: '二级审核通过',
[REPAIR_INNER_STATUS_FAILED]: '审核不通过',
[REPAIR_INNER_STATUS_CONFIRM_SUCCESS]: '确认审核通过',
[REPAIR_INNER_STATUS_CONFIRM_FAILED]: '确认审核不通过',
[REPAIR_INNER_STATUS_FINISHED]: '确认售后完成',
};
// 售后维修申请外部状态
export const REPAIR_OUTER_STATUS_UNCOMMITTED = 1; // 待提交申请单
export const REPAIR_OUTER_STATUS_UNCONFIRMED = 2; // 待确认
export const REPAIR_OUTER_STATUS_FAILED = 3; // 不接受申请
export const REPAIR_OUTER_STATUS_SUCCESS = 4; // 接受申请
export const REPAIR_OUTER_STATUS_FINISHED = 5; // 售后完成
export const REPAIR_OUTER_STATUS = {
[REPAIR_OUTER_STATUS_UNCOMMITTED]: '待提交',
[REPAIR_OUTER_STATUS_UNCONFIRMED]: '待确认',
[REPAIR_OUTER_STATUS_FAILED]: '不接受申请',
[REPAIR_OUTER_STATUS_SUCCESS]: '接受申请',
[REPAIR_OUTER_STATUS_FINISHED]: '售后完成',
};
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-05 10:30:54 * @Date: 2020-11-05 10:30:54
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-05 13:51:47 * @LastEditTime: 2020-11-10 10:48:56
* @Description: 地址 Form Item * @Description: 地址 Form Item
*/ */
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
...@@ -37,15 +37,15 @@ const AddressFormItem: React.FC<AddressFormItemProps> & { isFieldComponent: bool ...@@ -37,15 +37,15 @@ const AddressFormItem: React.FC<AddressFormItemProps> & { isFieldComponent: bool
}) => { }) => {
const [showMore, setShowMore] = useState(false); const [showMore, setShowMore] = useState(false);
useEffect(() => { // useEffect(() => {
// 默认选中第一个 // // 默认选中第一个
if (dataSource && dataSource.length && !value) { // if (dataSource && dataSource.length && !value) {
if (onChange) { // if (onChange) {
onChange(dataSource[0].id); // onChange(dataSource[0].id);
} // }
} // }
}, [dataSource]); // }, [dataSource]);
const showDataSource = !showMore ? [...dataSource].splice(0, showCount) : dataSource; const showDataSource = !showMore ? [...dataSource].splice(0, showCount) : dataSource;
...@@ -94,6 +94,6 @@ const AddressFormItem: React.FC<AddressFormItemProps> & { isFieldComponent: bool ...@@ -94,6 +94,6 @@ const AddressFormItem: React.FC<AddressFormItemProps> & { isFieldComponent: bool
AddressFormItem.defaultProps = {}; AddressFormItem.defaultProps = {};
AddressFormItem.isFieldComponent = true; AddressFormItem.isFieldComponent = false;
export default AddressFormItem; export default AddressFormItem;
\ No newline at end of file
...@@ -10,7 +10,7 @@ export const auditModalSchema: ISchema = { ...@@ -10,7 +10,7 @@ export const auditModalSchema: ISchema = {
labelAlign: 'top', labelAlign: 'top',
}, },
properties: { properties: {
star: { level: {
type: 'string', type: 'string',
title: '售后满意度', title: '售后满意度',
default: 5, default: 5,
...@@ -24,7 +24,7 @@ export const auditModalSchema: ISchema = { ...@@ -24,7 +24,7 @@ export const auditModalSchema: ISchema = {
'x-component': 'radio', 'x-component': 'radio',
'x-component-props': {}, 'x-component-props': {},
}, },
comment: { content: {
type: 'string', type: 'string',
title: '售后评价', title: '售后评价',
'x-component': 'textarea', 'x-component': 'textarea',
......
import {
REPAIR_OUTER_STATUS_UNCOMMITTED,
REPAIR_OUTER_STATUS_UNCONFIRMED,
REPAIR_OUTER_STATUS_FAILED,
REPAIR_OUTER_STATUS_SUCCESS,
REPAIR_OUTER_STATUS_FINISHED,
REPAIR_INNER_STATUS_UNCOMMITTED,
REPAIR_INNER_STATUS_COMMITTED,
REPAIR_INNER_STATUS_SUCCESS_1,
REPAIR_INNER_STATUS_SUCCESS_2,
REPAIR_INNER_STATUS_FAILED,
REPAIR_INNER_STATUS_CONFIRM_SUCCESS,
REPAIR_INNER_STATUS_CONFIRM_FAILED,
REPAIR_INNER_STATUS_FINISHED,
} from '@/constants';
// 售后维修外部状态 StatusTag map
export const REPAIR_OUTER_STATUS_TAG_MAP = {
[REPAIR_OUTER_STATUS_UNCOMMITTED]: 'default',
[REPAIR_OUTER_STATUS_UNCONFIRMED]: 'success',
[REPAIR_OUTER_STATUS_FAILED]: 'danger',
[REPAIR_OUTER_STATUS_SUCCESS]: 'primary',
[REPAIR_OUTER_STATUS_FINISHED]: 'success',
};
// 售后维修内部部状态 Badge map
export const REPAIR_INNER_STATUS_BADGE_MAP = {
[REPAIR_INNER_STATUS_UNCOMMITTED]: '#669EDE',
[REPAIR_INNER_STATUS_COMMITTED]: '#41CC9E',
[REPAIR_INNER_STATUS_SUCCESS_1]: '#41CC9E',
[REPAIR_INNER_STATUS_SUCCESS_2]: '#41CC9E',
[REPAIR_INNER_STATUS_FAILED]: '#EF6260',
[REPAIR_INNER_STATUS_CONFIRM_SUCCESS]: '#6C9CEB',
[REPAIR_INNER_STATUS_CONFIRM_FAILED]: '#EF6260',
[REPAIR_INNER_STATUS_FINISHED]: '#41CC9E',
};
\ No newline at end of file
...@@ -27,9 +27,9 @@ import NiceForm from '@/components/NiceForm'; ...@@ -27,9 +27,9 @@ import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import { listSearchSchema } from './schema'; import { listSearchSchema } from './schema';
import { import {
CREDIT_OUTER_STATUS_TAG_MAP, REPAIR_OUTER_STATUS_TAG_MAP,
CREDIT_INNER_STATUS_BADGE_MAP, REPAIR_INNER_STATUS_BADGE_MAP,
} from '../../contants'; } from '../../constants';
import styles from './index.less'; import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
...@@ -54,17 +54,17 @@ const RepairPrFinished: React.FC = () => { ...@@ -54,17 +54,17 @@ const RepairPrFinished: React.FC = () => {
}, },
{ {
title: '申请单摘要', title: '申请单摘要',
dataIndex: 'parentMemberName', dataIndex: 'applyAbstract',
align: 'center', align: 'center',
}, },
{ {
title: '供应会员', title: '供应会员',
dataIndex: 'supplier', dataIndex: 'supplierName',
align: 'center', align: 'center',
}, },
{ {
title: '单据时间', title: '单据时间',
dataIndex: 'created', dataIndex: 'applyTime',
align: 'center', align: 'center',
}, },
{ {
...@@ -74,7 +74,7 @@ const RepairPrFinished: React.FC = () => { ...@@ -74,7 +74,7 @@ const RepairPrFinished: React.FC = () => {
filters: [], filters: [],
onFilter: (value, record) => record.outerStatus === value, onFilter: (value, record) => record.outerStatus === value,
render: (text, record) => ( render: (text, record) => (
<StatusTag type="success" title="售后完成" /> <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.outerStatus]} title={text} />
), ),
}, },
{ {
...@@ -83,7 +83,7 @@ const RepairPrFinished: React.FC = () => { ...@@ -83,7 +83,7 @@ const RepairPrFinished: React.FC = () => {
align: 'center', align: 'center',
filters: [], filters: [],
onFilter: (value, record) => record.innerStatus === value, onFilter: (value, record) => record.innerStatus === value,
render: (text, record) => <Badge color={'#6C9CEB'} text="待确认售后完成" />, render: (text, record) => <Badge color={REPAIR_INNER_STATUS_BADGE_MAP[record.innerStatus]} text={text} />,
}, },
{ {
title: '操作', title: '操作',
...@@ -106,67 +106,67 @@ const RepairPrFinished: React.FC = () => { ...@@ -106,67 +106,67 @@ const RepairPrFinished: React.FC = () => {
const fetchListData = (params: any) => { const fetchListData = (params: any) => {
const { startTime, endTime, ...rest } = params; const { startTime, endTime, ...rest } = params;
// return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// PublicApi.getPayCreditApplyPageCreditApply({ PublicApi.getAsRepairGoodsPageToBeConfirmComplete({
// startTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null, startTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// endTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null, endTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// ...rest, ...rest,
// }) })
// .then(res => { .then(res => {
// if (res.code === 1000) { if (res.code === 1000) {
// resolve(res.data); resolve(res.data);
// } }
// reject(); reject();
// }) })
// .catch(() => { .catch(() => {
// reject(); reject();
// }); });
// });
return Promise.resolve({
data: [
{
id: 1,
applyNo: '123',
parentMemberName: '申请单摘要',
created: '2020-11-03 11:46:00',
},
],
total: 10,
}); });
// return Promise.resolve({
// data: [
// {
// id: 1,
// applyNo: '123',
// parentMemberName: '申请单摘要',
// created: '2020-11-03 11:46:00',
// },
// ],
// total: 10,
// });
}; };
// 初始化高级筛选选项 // 初始化高级筛选选项
const fetchSearchItems = async () => { const fetchSearchItems = async () => {
// const res = await PublicApi.getPayCreditApplyPageItemsByConsumer(); const res = await PublicApi.getAsRepairGoodsPageItems();
// if (res.code === 1000) { if (res.code === 1000) {
// const { data } = res; const { data } = res;
// const { const {
// outerStatusList = [], outerStatusList = [],
// innerStatusList = [], innerStatusList = [],
// } = data; } = data;
// const newColumns = columns.slice(); const newColumns = columns.slice();
// // filter 0 过滤掉全部选项 // filter 0 过滤掉全部选项
// coverColFiltersItem( coverColFiltersItem(
// newColumns, newColumns,
// 'outerStatusName', 'outerStatusName',
// outerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value), outerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// ); );
// coverColFiltersItem( coverColFiltersItem(
// newColumns, newColumns,
// 'innerStatusName', 'innerStatusName',
// innerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value), innerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// ); );
// setColumns(newColumns); setColumns(newColumns);
// return { return {
// outerStatus: outerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value), outerStatus: outerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// innerStatus: innerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value), innerStatus: innerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// }; };
// } }
return {}; return {};
}; };
......
...@@ -35,7 +35,7 @@ export const listSearchSchema: ISchema = { ...@@ -35,7 +35,7 @@ export const listSearchSchema: ISchema = {
columns: 6, columns: 6,
}, },
properties: { properties: {
abstract: { applyAbstract: {
type: 'string', type: 'string',
'x-component-props': { 'x-component-props': {
placeholder: '申请单摘要', placeholder: '申请单摘要',
...@@ -51,12 +51,11 @@ export const listSearchSchema: ISchema = { ...@@ -51,12 +51,11 @@ export const listSearchSchema: ISchema = {
allowClear: true, allowClear: true,
}, },
}, },
supplier: { supplierName: {
type: 'string', type: 'string',
default: undefined, default: undefined,
enum: [],
'x-component-props': { 'x-component-props': {
placeholder: '供应会员(全部)', placeholder: '供应会员',
allowClear: true, allowClear: true,
}, },
}, },
......
/* /*
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-11-04 17:22:07 * @Date: 2020-11-06 17:21:54
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-11-04 17:29:08 * @LastEditTime: 2020-11-10 15:08:07
* @Description: * @Description: 确认售后完成
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Button } from 'antd'; import { Button } from 'antd';
...@@ -15,12 +15,25 @@ import DetailInfo from '../components/DetailInfo'; ...@@ -15,12 +15,25 @@ import DetailInfo from '../components/DetailInfo';
import FinishedModal from '../../components/FinishedModal'; import FinishedModal from '../../components/FinishedModal';
const RepairPrFinishedDetailVerify: React.FC = () => { const RepairPrFinishedDetailVerify: React.FC = () => {
const { id, creditId } = usePageStatus(); const { id } = usePageStatus();
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [confirmLoading, setConfirmLoading] = useState(false); const [confirmLoading, setConfirmLoading] = useState(false);
const handleSubmit = values => { const handleSubmit = values => {
if (!id) {
return;
}
setConfirmLoading(true);
PublicApi.postAsRepairGoodsConfirmComplete({
repairId: id,
evaluate: values,
}).then(res => {
if (res.code === 1000) {
history.goBack();
}
}).finally(() => {
setConfirmLoading(false);
});
}; };
return ( return (
......
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import Search from '@/components/NiceForm/components/Search'; import Search from '@/components/NiceForm/components/Search';
import Submit from '@/components/NiceForm/components/Submit'; import Submit from '@/components/NiceForm/components/Submit';
import DateSelect from '@/components/NiceForm/components/DateSelect';
import { import {
} from '@/constants'; } from '@/constants';
import { PATTERN_MAPS } from '@/constants/regExp'; import { PATTERN_MAPS } from '@/constants/regExp';
import { UPLOAD_TYPE } from '@/constants'; import { UPLOAD_TYPE } from '@/constants';
import { PublicApi } from '@/services/api';
// 供应会员列表列 // 供应会员列表列
const supplierColumns = [ const supplierColumns = [
...@@ -19,55 +17,36 @@ const supplierColumns = [ ...@@ -19,55 +17,36 @@ const supplierColumns = [
}, },
{ {
title: '会员名称', title: '会员名称',
dataIndex: 'memberName', dataIndex: 'name',
align: 'center', align: 'center',
}, },
{ {
title: '会员类型', title: '会员类型',
dataIndex: 'memberType', dataIndex: 'memberTypeName',
align: 'center', align: 'center',
}, },
{ {
title: '会员角色', title: '会员角色',
dataIndex: 'memberRole', dataIndex: 'roleName',
align: 'center', align: 'center',
}, },
{ {
title: '会员等级', title: '会员等级',
dataIndex: 'memberLevel', dataIndex: 'levelTag',
align: 'center', align: 'center',
}, },
]; ];
// 获取供应会员 // 获取供应会员
const getSupplier = () => { const getSupplier = async (params) => {
return Promise.resolve({ const res = await PublicApi.getMemberManageLowerMerchantProviderPage({
data: [ ...params,
{ })
memberId: 1, if (res.code === 1000) {
memberName: '会员1', return res.data;
memberType: '企业会员', }
memberRole: '青铜会员', return { totalCount: 0, data: [] };
memberLevel: '会员等级',
},
{
memberId: 2,
memberName: '会员2',
memberType: '企业会员',
memberRole: '青铜会员',
memberLevel: '会员等级',
},
{
memberId: 3,
memberName: '会员3',
memberType: '企业会员',
memberRole: '青铜会员',
memberLevel: '会员等级',
},
],
total: 20,
});
}; };
const supplierSchema: ISchema = { const supplierSchema: ISchema = {
...@@ -77,7 +56,7 @@ const supplierSchema: ISchema = { ...@@ -77,7 +56,7 @@ const supplierSchema: ISchema = {
type: 'object', type: 'object',
'x-component': 'Mega-Layout', 'x-component': 'Mega-Layout',
properties: { properties: {
search: { name: {
type: 'string', type: 'string',
'x-component': 'Search', 'x-component': 'Search',
'x-mega-props': {}, 'x-mega-props': {},
...@@ -118,7 +97,7 @@ export const addBillSchema: ISchema = { ...@@ -118,7 +97,7 @@ export const addBillSchema: ISchema = {
labelAlign: 'left', labelAlign: 'left',
}, },
properties: { properties: {
invoicesAbstract: { applyAbstract: {
type: 'string', type: 'string',
title: '申请单摘要', title: '申请单摘要',
required: true, required: true,
...@@ -131,7 +110,7 @@ export const addBillSchema: ISchema = { ...@@ -131,7 +110,7 @@ export const addBillSchema: ISchema = {
wrapperCol: 24, wrapperCol: 24,
}, },
properties: { properties: {
supplier: { supplierMember: {
type: 'string', type: 'string',
title: '供应会员', title: '供应会员',
'x-component': 'CustomRelevance', 'x-component': 'CustomRelevance',
...@@ -139,7 +118,7 @@ export const addBillSchema: ISchema = { ...@@ -139,7 +118,7 @@ export const addBillSchema: ISchema = {
title: '关联', title: '关联',
tip: '请选择对应单据', tip: '请选择对应单据',
modalProps: { modalProps: {
title: '标题', title: '选择会员',
}, },
columns: supplierColumns, columns: supplierColumns,
fetchTableData: getSupplier, fetchTableData: getSupplier,
...@@ -149,22 +128,16 @@ export const addBillSchema: ISchema = { ...@@ -149,22 +128,16 @@ export const addBillSchema: ISchema = {
components: { components: {
Search, Search,
Submit, Submit,
DateSelect,
}, },
effects: ($, actions) => { effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'search',
FORM_FILTER_PATH,
);
}, },
inline: false, inline: false,
} }
}, },
tableProps: { tableProps: {
rowKey: 'memberId', rowKey: 'memberId',
lableKey: 'memberName', lableKey: 'name',
}, },
}, },
'x-mega-props': { 'x-mega-props': {
...@@ -346,7 +319,7 @@ export const addBillSchema: ISchema = { ...@@ -346,7 +319,7 @@ export const addBillSchema: ISchema = {
labelAlign: 'left', labelAlign: 'left',
}, },
properties: { properties: {
enclosure: { faultFileList: {
title: '附件', title: '附件',
'x-component': 'Upload', 'x-component': 'Upload',
'x-component-props': { 'x-component-props': {
...@@ -385,7 +358,7 @@ export const addBillSchema: ISchema = { ...@@ -385,7 +358,7 @@ export const addBillSchema: ISchema = {
labelAlign: 'left', labelAlign: 'left',
}, },
properties: { properties: {
address: { repairAddress: {
title: '维修地址', title: '维修地址',
type: 'string', type: 'string',
'x-component': 'AddressFormItem', 'x-component': 'AddressFormItem',
......
...@@ -27,9 +27,9 @@ import NiceForm from '@/components/NiceForm'; ...@@ -27,9 +27,9 @@ import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import { listSearchSchema } from './schema'; import { listSearchSchema } from './schema';
import { import {
CREDIT_OUTER_STATUS_TAG_MAP, REPAIR_OUTER_STATUS_TAG_MAP,
CREDIT_INNER_STATUS_BADGE_MAP, REPAIR_INNER_STATUS_BADGE_MAP,
} from '../../contants'; } from '../../constants';
import styles from './index.less'; import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
...@@ -54,17 +54,17 @@ const RepairPrSubmit: React.FC = () => { ...@@ -54,17 +54,17 @@ const RepairPrSubmit: React.FC = () => {
}, },
{ {
title: '申请单摘要', title: '申请单摘要',
dataIndex: 'parentMemberName', dataIndex: 'applyAbstract',
align: 'center', align: 'center',
}, },
{ {
title: '供应会员', title: '供应会员',
dataIndex: 'supplier', dataIndex: 'supplierName',
align: 'center', align: 'center',
}, },
{ {
title: '单据时间', title: '单据时间',
dataIndex: 'created', dataIndex: 'applyTime',
align: 'center', align: 'center',
}, },
{ {
...@@ -74,7 +74,7 @@ const RepairPrSubmit: React.FC = () => { ...@@ -74,7 +74,7 @@ const RepairPrSubmit: React.FC = () => {
filters: [], filters: [],
onFilter: (value, record) => record.outerStatus === value, onFilter: (value, record) => record.outerStatus === value,
render: (text, record) => ( render: (text, record) => (
<StatusTag type="success" title="售后完成" /> <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.outerStatus]} title={text} />
), ),
}, },
{ {
...@@ -83,7 +83,7 @@ const RepairPrSubmit: React.FC = () => { ...@@ -83,7 +83,7 @@ const RepairPrSubmit: React.FC = () => {
align: 'center', align: 'center',
filters: [], filters: [],
onFilter: (value, record) => record.innerStatus === value, onFilter: (value, record) => record.innerStatus === value,
render: (text, record) => <Badge color={'#6C9CEB'} text="待确认售后完成" />, render: (text, record) => <Badge color={REPAIR_INNER_STATUS_BADGE_MAP[record.innerStatus]} text={text} />,
}, },
{ {
title: '操作', title: '操作',
...@@ -125,67 +125,67 @@ const RepairPrSubmit: React.FC = () => { ...@@ -125,67 +125,67 @@ const RepairPrSubmit: React.FC = () => {
const fetchListData = (params: any) => { const fetchListData = (params: any) => {
const { startTime, endTime, ...rest } = params; const { startTime, endTime, ...rest } = params;
// return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// PublicApi.getPayCreditApplyPageCreditApply({ PublicApi.getAsRepairGoodsPageToBeSubmitByConsumer({
// startTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null, startTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// endTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null, endTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// ...rest, ...rest,
// }) })
// .then(res => { .then(res => {
// if (res.code === 1000) { if (res.code === 1000) {
// resolve(res.data); resolve(res.data);
// } }
// reject(); reject();
// }) })
// .catch(() => { .catch(() => {
// reject(); reject();
// }); });
// });
return Promise.resolve({
data: [
{
id: 1,
applyNo: '123',
parentMemberName: '申请单摘要',
created: '2020-11-03 11:46:00',
},
],
total: 10,
}); });
// return Promise.resolve({
// data: [
// {
// id: 1,
// applyNo: '123',
// parentMemberName: '申请单摘要',
// created: '2020-11-03 11:46:00',
// },
// ],
// total: 10,
// });
}; };
// 初始化高级筛选选项 // 初始化高级筛选选项
const fetchSearchItems = async () => { const fetchSearchItems = async () => {
// const res = await PublicApi.getPayCreditApplyPageItemsByConsumer(); const res = await PublicApi.getAsRepairGoodsPageItems();
// if (res.code === 1000) { if (res.code === 1000) {
// const { data } = res; const { data } = res;
// const { const {
// outerStatusList = [], outerStatusList = [],
// innerStatusList = [], innerStatusList = [],
// } = data; } = data;
// const newColumns = columns.slice(); const newColumns = columns.slice();
// // filter 0 过滤掉全部选项 // filter 0 过滤掉全部选项
// coverColFiltersItem( coverColFiltersItem(
// newColumns, newColumns,
// 'outerStatusName', 'outerStatusName',
// outerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value), outerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// ); );
// coverColFiltersItem( coverColFiltersItem(
// newColumns, newColumns,
// 'innerStatusName', 'innerStatusName',
// innerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value), innerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// ); );
// setColumns(newColumns); setColumns(newColumns);
// return { return {
// outerStatus: outerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value), outerStatus: outerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// innerStatus: innerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value), innerStatus: innerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// }; };
// } }
return {}; return {};
}; };
...@@ -226,7 +226,7 @@ const RepairPrSubmit: React.FC = () => { ...@@ -226,7 +226,7 @@ const RepairPrSubmit: React.FC = () => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'cond', 'applyNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
useAsyncInitSelect( useAsyncInitSelect(
......
...@@ -30,11 +30,12 @@ export const listSearchSchema: ISchema = { ...@@ -30,11 +30,12 @@ export const listSearchSchema: ISchema = {
children: '{{controllerBtns}}', children: '{{controllerBtns}}',
}, },
}, },
cond: { applyNo: {
type: 'string', type: 'string',
'x-component': 'Search', 'x-component': 'Search',
'x-component-props': { 'x-component-props': {
placeholder: '搜索', placeholder: '搜索',
tip: '输入 申请单号 进行搜索',
}, },
}, },
}, },
...@@ -48,7 +49,7 @@ export const listSearchSchema: ISchema = { ...@@ -48,7 +49,7 @@ export const listSearchSchema: ISchema = {
}, },
}, },
properties: { properties: {
abstract: { applyAbstract: {
type: 'string', type: 'string',
'x-component-props': { 'x-component-props': {
placeholder: '申请单摘要', placeholder: '申请单摘要',
...@@ -63,12 +64,11 @@ export const listSearchSchema: ISchema = { ...@@ -63,12 +64,11 @@ export const listSearchSchema: ISchema = {
allowClear: true, allowClear: true,
}, },
}, },
supplier: { supplierName: {
type: 'string', type: 'string',
default: undefined, default: undefined,
enum: [],
'x-component-props': { 'x-component-props': {
placeholder: '供应会员(全部)', placeholder: '供应会员',
allowClear: true, allowClear: true,
}, },
}, },
......
...@@ -18,9 +18,9 @@ import NiceForm from '@/components/NiceForm'; ...@@ -18,9 +18,9 @@ import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import { listSearchSchema } from './schema'; import { listSearchSchema } from './schema';
import { import {
CREDIT_OUTER_STATUS_TAG_MAP, REPAIR_OUTER_STATUS_TAG_MAP,
CREDIT_INNER_STATUS_BADGE_MAP, REPAIR_INNER_STATUS_BADGE_MAP,
} from '../../contants'; } from '../../constants';
import styles from './index.less'; import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
...@@ -45,17 +45,17 @@ const RepairQuery: React.FC = () => { ...@@ -45,17 +45,17 @@ const RepairQuery: React.FC = () => {
}, },
{ {
title: '申请单摘要', title: '申请单摘要',
dataIndex: 'parentMemberName', dataIndex: 'applyAbstract',
align: 'center', align: 'center',
}, },
{ {
title: '供应会员', title: '供应会员',
dataIndex: 'supplier', dataIndex: 'supplierName',
align: 'center', align: 'center',
}, },
{ {
title: '单据时间', title: '单据时间',
dataIndex: 'created', dataIndex: 'applyTime',
align: 'center', align: 'center',
}, },
{ {
...@@ -65,7 +65,7 @@ const RepairQuery: React.FC = () => { ...@@ -65,7 +65,7 @@ const RepairQuery: React.FC = () => {
filters: [], filters: [],
onFilter: (value, record) => record.outerStatus === value, onFilter: (value, record) => record.outerStatus === value,
render: (text, record) => ( render: (text, record) => (
<StatusTag type="success" title="售后完成" /> <StatusTag type={REPAIR_OUTER_STATUS_TAG_MAP[record.outerStatus]} title={text} />
), ),
}, },
{ {
...@@ -74,7 +74,7 @@ const RepairQuery: React.FC = () => { ...@@ -74,7 +74,7 @@ const RepairQuery: React.FC = () => {
align: 'center', align: 'center',
filters: [], filters: [],
onFilter: (value, record) => record.innerStatus === value, onFilter: (value, record) => record.innerStatus === value,
render: (text, record) => <Badge color={'#6C9CEB'} text="待确认售后完成" />, render: (text, record) => <Badge color={REPAIR_INNER_STATUS_BADGE_MAP[record.innerStatus]} text={text} />,
}, },
]; ];
...@@ -82,67 +82,56 @@ const RepairQuery: React.FC = () => { ...@@ -82,67 +82,56 @@ const RepairQuery: React.FC = () => {
const fetchListData = (params: any) => { const fetchListData = (params: any) => {
const { startTime, endTime, ...rest } = params; const { startTime, endTime, ...rest } = params;
// return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// PublicApi.getPayCreditApplyPageCreditApply({ PublicApi.getAsRepairGoodsPageByConsumer({
// startTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null, startTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// endTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null, endTime: startTime ? moment(startTime).format('YYYY-MM-DD') : null,
// ...rest, ...rest,
// }) })
// .then(res => { .then(res => {
// if (res.code === 1000) { if (res.code === 1000) {
// resolve(res.data); resolve(res.data);
// } }
// reject(); reject();
// }) })
// .catch(() => { .catch(() => {
// reject(); reject();
// }); });
// });
return Promise.resolve({
data: [
{
id: 1,
applyNo: '123',
parentMemberName: '申请单摘要',
created: '2020-11-03 11:46:00',
},
],
total: 10,
}); });
}; };
// 初始化高级筛选选项 // 初始化高级筛选选项
const fetchSearchItems = async () => { const fetchSearchItems = async () => {
// const res = await PublicApi.getPayCreditApplyPageItemsByConsumer(); const res = await PublicApi.getAsRepairGoodsPageItems();
// if (res.code === 1000) { if (res.code === 1000) {
// const { data } = res; const { data } = res;
// const { const {
// outerStatusList = [], outerStatusList = [],
// innerStatusList = [], innerStatusList = [],
// } = data; } = data;
// const newColumns = columns.slice(); const newColumns = columns.slice();
// // filter 0 过滤掉全部选项 // filter 0 过滤掉全部选项
// coverColFiltersItem( coverColFiltersItem(
// newColumns, newColumns,
// 'outerStatusName', 'outerStatusName',
// outerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value), outerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// ); );
// coverColFiltersItem( coverColFiltersItem(
// newColumns, newColumns,
// 'innerStatusName', 'innerStatusName',
// innerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value), innerStatusList.map(item => ({ text: item.name, value: item.status })).filter(item => item.value),
// ); );
// setColumns(newColumns); setColumns(newColumns);
// return { return {
// outerStatus: outerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value), outerStatus: outerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// innerStatus: innerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value), innerStatus: innerStatusList.map(item => ({ label: item.name, value: item.status })).filter(item => item.value),
// }; };
// } }
return {}; return {};
}; };
......
...@@ -35,7 +35,7 @@ export const listSearchSchema: ISchema = { ...@@ -35,7 +35,7 @@ export const listSearchSchema: ISchema = {
columns: 6, columns: 6,
}, },
properties: { properties: {
abstract: { applyAbstract: {
type: 'string', type: 'string',
'x-component-props': { 'x-component-props': {
placeholder: '申请单摘要', placeholder: '申请单摘要',
...@@ -51,12 +51,11 @@ export const listSearchSchema: ISchema = { ...@@ -51,12 +51,11 @@ export const listSearchSchema: ISchema = {
allowClear: true, allowClear: true,
}, },
}, },
supplier: { supplierName: {
type: 'string', type: 'string',
default: undefined, default: undefined,
enum: [],
'x-component-props': { 'x-component-props': {
placeholder: '供应会员(全部)', placeholder: '供应会员',
allowClear: true, allowClear: true,
}, },
}, },
......
...@@ -353,7 +353,11 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState> ...@@ -353,7 +353,11 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
</div> </div>
</> </>
) : ( ) : (
<TradeRecord fetchRecordList={this.getRecordList} ref={node => this.tradeRecordRef = node} /> <TradeRecord
fetchRecordList={this.getRecordList}
ref={node => this.tradeRecordRef = node}
onConfirm={this.handleConfirm}
/>
)} )}
</Spin> </Spin>
</MellowCard> </MellowCard>
......
...@@ -31,6 +31,7 @@ export interface RecordParams { ...@@ -31,6 +31,7 @@ export interface RecordParams {
}; };
export interface RecordItem { export interface RecordItem {
id: number
/** /**
* 交易流水号 * 交易流水号
*/ */
...@@ -165,11 +166,11 @@ class TradeRecord extends React.Component<TradeRecordProps, TradeRecordState> { ...@@ -165,11 +166,11 @@ class TradeRecord extends React.Component<TradeRecordProps, TradeRecordState> {
}); });
}; };
handleVisibleResult = (flag, recordId?, voucher? = []) => { handleVisibleResult = (flag, recordId?, voucher?) => {
this.setState({ this.setState({
visibleResult: !!flag, visibleResult: !!flag,
recordId, recordId,
currentVoucher: voucher.map(item => normalizeFiledata(item.proveUrl)), currentVoucher: voucher ? voucher.map(item => normalizeFiledata(item.proveUrl)) : [],
}); });
}; };
...@@ -195,6 +196,7 @@ class TradeRecord extends React.Component<TradeRecordProps, TradeRecordState> { ...@@ -195,6 +196,7 @@ class TradeRecord extends React.Component<TradeRecordProps, TradeRecordState> {
}).then(res => { }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
this.handleVisibleResult(false); this.handleVisibleResult(false);
this.getRecordList();
} }
}).finally(() => { }).finally(() => {
if (flag === BILL_TRADE_STATUS_OUTSTANDIND) { if (flag === BILL_TRADE_STATUS_OUTSTANDIND) {
...@@ -239,11 +241,11 @@ class TradeRecord extends React.Component<TradeRecordProps, TradeRecordState> { ...@@ -239,11 +241,11 @@ class TradeRecord extends React.Component<TradeRecordProps, TradeRecordState> {
<Descriptions column={1}> <Descriptions column={1}>
<Descriptions.Item label="交易流水号"> <Descriptions.Item label="交易流水号">
<Row justify="space-between"> <Row justify="space-between">
<Col span={12}> <Col span={10}>
<a onClick={() => this.handleCheckVoucher(item.payProveList)}>{item.tradeCode}</a> <a onClick={() => this.handleCheckVoucher(item.payProveList)}>{item.tradeCode}</a>
</Col> </Col>
<Col <Col
span={10} span={14}
style={{ style={{
textAlign: 'right', textAlign: 'right',
}} }}
...@@ -270,7 +272,12 @@ class TradeRecord extends React.Component<TradeRecordProps, TradeRecordState> { ...@@ -270,7 +272,12 @@ class TradeRecord extends React.Component<TradeRecordProps, TradeRecordState> {
<Descriptions.Item label="交易时间">{item.tradeTime}</Descriptions.Item> <Descriptions.Item label="交易时间">{item.tradeTime}</Descriptions.Item>
<Descriptions.Item label="备注"> <Descriptions.Item label="备注">
<Row justify="space-between"> <Row justify="space-between">
<Col span={item.status === BILL_TRADE_STATUS_UNCONFIRMED ? 12 : 24}> <Col
span={item.status === BILL_TRADE_STATUS_UNCONFIRMED ? 12 : 24}
style={{
height: 32,
}}
>
{item.remark} {item.remark}
</Col> </Col>
{/* 状态等于 待确认还款 */} {/* 状态等于 待确认还款 */}
......
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