Commit 58cd5ee7 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

feat: 交易能力 -> 供应会员评价管理国际化

parent 78925a60
...@@ -19,6 +19,7 @@ import logistics from './zh-CN/logistics' ...@@ -19,6 +19,7 @@ import logistics from './zh-CN/logistics'
import dealAbility from './zh-CN/dealAbility' import dealAbility from './zh-CN/dealAbility'
import purchaserEvaluation from './zh-CN/purchaserEvaluation' import purchaserEvaluation from './zh-CN/purchaserEvaluation'
import stockSellStorage from './zh-CN/stockSellStorage' import stockSellStorage from './zh-CN/stockSellStorage'
import supplierEvaluation from './zh-CN/supplierEvaluation'
import content from './zh-CN/content' import content from './zh-CN/content'
import commodity from './zh-CN/commodity' import commodity from './zh-CN/commodity'
import trademark from './zh-CN/trademark' import trademark from './zh-CN/trademark'
...@@ -53,6 +54,7 @@ export default { ...@@ -53,6 +54,7 @@ export default {
...dealAbility, ...dealAbility,
...purchaserEvaluation, ...purchaserEvaluation,
...stockSellStorage, ...stockSellStorage,
...supplierEvaluation,
...content, ...content,
...processRuleSetting, ...processRuleSetting,
} }
export default {
'supplierEvaluation.sousuo': '搜索',
'supplierEvaluation.shurudingdanhao': '输入 订单号 进行搜索',
'supplierEvaluation.dingdanzhaiyao': '订单摘要',
'supplierEvaluation.caigouhuiyuan': '采购会员',
'supplierEvaluation.xiadanshijian': '下单时间',
'supplierEvaluation.dingdanleixing': '订单类型',
'supplierEvaluation.chaxun': '查询',
'supplierEvaluation.tupiandaxiaochaoguo10M': '图片大小超过10M',
'supplierEvaluation.xiugai': '修改',
'supplierEvaluation.zhichiJPGPNGJPEG': '支持JPG/PNG/JPEG',
'supplierEvaluation.meizhangzuidabuchaoguo': '每张最大不超过 10M,尺寸不限',
'supplierEvaluation.zuidashuliangxianzhi4': '最大数量限制 4张',
'supplierEvaluation.ninhaiyouweibaocunde': '"您还有未保存的内容,是否确定要离开?"',
'supplierEvaluation.fabu': '发布',
'supplierEvaluation.dingdanhao': '订单号',
'supplierEvaluation.waibuzhuangtai': '外部状态',
'supplierEvaluation.neibuzhuangtai': '内部状态',
'supplierEvaluation.caozuo': '操作',
'supplierEvaluation.pingjia': '评价',
'supplierEvaluation.yiwancheng': '已完成',
'supplierEvaluation.zaicishurunideneirong': '在此输入你的内容',
'supplierEvaluation.qingshuruneirong': '请输入内容',
'supplierEvaluation.shangjiajieshi': '商家解释',
'supplierEvaluation.shangjiaduiyupingjiadejie': '商家对于评价的解释,显示在商品交易评价中',
'supplierEvaluation.beipingjiafang': '被评价方',
'supplierEvaluation.fachudepingjia': '发出的评价',
'supplierEvaluation.shoudaodepingjia': '收到的评价',
'supplierEvaluation.pingjiajilu': '评价记录',
'supplierEvaluation.leijipingjia': '累计评价',
'supplierEvaluation.pingjiatongji': '评价统计',
'supplierEvaluation.gailan': '概览',
'supplierEvaluation.180tianqian': '180天前',
'supplierEvaluation.zuijin180tian': '最近180天',
'supplierEvaluation.zuijin30tian': '最近30天',
'supplierEvaluation.zuijin7tian': '最近7天',
'supplierEvaluation.chaping': '差评',
'supplierEvaluation.zhongping': '中评',
'supplierEvaluation.haoping': '好评',
'supplierEvaluation.dingdanzonge': '订单总额',
}
/* /*
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-08-11 14:20:42 * @Date: 2021-08-11 14:20:42
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-18 10:44:56 * @LastEditTime: 2021-08-18 10:44:56
* @Description: 解释 Modal * @Description: 解释 Modal
*/ */
import React from 'react'; import React from 'react';
import { Modal, Tooltip } from 'antd'; import { Modal, Tooltip } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons'; import { QuestionCircleOutlined } from '@ant-design/icons';
import { createAsyncFormActions } from '@formily/antd'; import { createAsyncFormActions } from '@formily/antd';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import schema from './schema'; import schema from './schema';
import { getIntl } from 'umi';
const modalFormActions = createAsyncFormActions(); const intl = getIntl();
const modalFormActions = createAsyncFormActions();
export type ValuesType = {
/** export type ValuesType = {
* 解释内容 /**
*/ * 解释内容
content: string, */
} content: string,
}
interface ExplainModalProps {
visible: boolean; interface ExplainModalProps {
confirmLoading: boolean; visible: boolean;
onSubmit: (values: ValuesType) => void; confirmLoading: boolean;
/** onSubmit: (values: ValuesType) => void;
* 关闭触发事件 /**
*/ * 关闭触发事件
onClose: () => void; */
/** onClose: () => void;
* 是否只可以选择 不接受申请 /**
*/ * 是否只可以选择 不接受申请
rejected?: boolean; */
} rejected?: boolean;
}
const ExplainModal: React.FC<ExplainModalProps> = (props) => {
const { const ExplainModal: React.FC<ExplainModalProps> = (props) => {
visible, const {
confirmLoading, visible,
onSubmit, confirmLoading,
onClose, onSubmit,
} = props; onClose,
} = props;
const handleClose = () => {
onClose?.(); const handleClose = () => {
}; onClose?.();
};
const handleSubmit = values => {
if (onSubmit) { const handleSubmit = values => {
onSubmit(values); if (onSubmit) {
} onSubmit(values);
}; }
};
return (
<Modal return (
title={( <Modal
<> title={(
商家解释 <>
<Tooltip title="商家对于评价的解释,显示在商品交易评价中"> {intl.formatMessage({id: 'supplierEvaluation.shangjiajieshi'})}
<QuestionCircleOutlined style={{ marginLeft: 3 }} /> <Tooltip title={intl.formatMessage({id: 'supplierEvaluation.shangjiaduiyupingjiadejie'})}>
</Tooltip> <QuestionCircleOutlined style={{ marginLeft: 3 }} />
</> </Tooltip>
)} </>
visible={visible} )}
confirmLoading={confirmLoading} visible={visible}
onOk={() => modalFormActions.submit()} confirmLoading={confirmLoading}
onCancel={handleClose} onOk={() => modalFormActions.submit()}
destroyOnClose onCancel={handleClose}
> destroyOnClose
<NiceForm >
effects={() => { <NiceForm
effects={() => {
}}
actions={modalFormActions} }}
schema={schema} actions={modalFormActions}
onSubmit={handleSubmit} schema={schema}
/> onSubmit={handleSubmit}
</Modal> />
); </Modal>
}; );
};
export default ExplainModal;
export default ExplainModal;
/* /*
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-08-11 14:23:08 * @Date: 2021-08-11 14:23:08
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-11 14:58:47 * @LastEditTime: 2021-08-11 14:58:47
* @Description: * @Description:
*/ */
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
const schema: ISchema = { const intl = getIntl();
type: 'object', const schema: ISchema = {
properties: { type: 'object',
MEGA_LAYOUT: { properties: {
type: 'object', MEGA_LAYOUT: {
'x-component': 'mega-layout', type: 'object',
'x-component-props': { 'x-component': 'mega-layout',
labelAlign: 'top', 'x-component-props': {
}, labelAlign: 'top',
properties: { },
content: { properties: {
type: 'string', content: {
'x-component': 'textarea', type: 'string',
'x-component-props': { 'x-component': 'textarea',
placeholder: '在此输入你的内容', 'x-component-props': {
rows: 5, placeholder: intl.formatMessage({id: 'supplierEvaluation.zaicishurunideneirong'}),
}, rows: 5,
'x-rules': [ },
{ 'x-rules': [
required: true, {
message: '请输入内容', required: true,
}, message: intl.formatMessage({id: 'supplierEvaluation.qingshuruneirong'}),
], },
}, ],
}, },
}, },
}, },
}; },
};
export default schema;
export default schema;
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import { Card, Badge, Button } from 'antd'; import { Card, Badge, Button } from 'antd';
import { Link } from 'umi'; import { getIntl, Link } from 'umi';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd'; import { createFormActions } from '@formily/antd';
import moment from 'moment'; import moment from 'moment';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'; import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getMemberOrderCommentVendorPage } from '@/services/MemberV2Api'; import { getMemberOrderCommentVendorPage } from '@/services/MemberV2Api';
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 { listSearchSchema } from './schema';
import styles from './index.less'; import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
const intl = getIntl();
const Unevaluated: React.FC = () => { const Unevaluated: React.FC = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const defaultColumns: ColumnType<any>[] = [ const defaultColumns: ColumnType<any>[] = [
{ {
title: '订单号', title: intl.formatMessage({id: 'supplierEvaluation.dingdanhao'}),
dataIndex: 'orderNo', dataIndex: 'orderNo',
align: 'center', align: 'center',
render: (text, record) => ( render: (text, record) => (
<EyePreview <EyePreview
url={`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated/order?id=${record.id}`} url={`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated/order?id=${record.id}`}
> >
{text} {text}
</EyePreview> </EyePreview>
), ),
}, },
{ {
title: '订单摘要', title: intl.formatMessage({id: 'supplierEvaluation.dingdanzhaiyao'}),
dataIndex: 'digest', dataIndex: 'digest',
align: 'center', align: 'center',
ellipsis: true, ellipsis: true,
}, },
{ {
title: '采购会员', title: intl.formatMessage({id: 'supplierEvaluation.caigouhuiyuan'}),
dataIndex: 'memberName', dataIndex: 'memberName',
align: 'center', align: 'center',
render: (text, record) => <>{text}</>, render: (text, record) => <>{text}</>,
}, },
{ {
title: '下单时间', title: intl.formatMessage({id: 'supplierEvaluation.xiadanshijian'}),
dataIndex: 'createTime', dataIndex: 'createTime',
align: 'center', align: 'center',
}, },
{ {
title: '订单总额', title: intl.formatMessage({id: 'supplierEvaluation.dingdanzonge'}),
dataIndex: 'totalAmount', dataIndex: 'totalAmount',
align: 'center', align: 'center',
render: (text) => ${text}`, render: (text) => ${text}`,
}, },
{ {
title: '订单类型', title: intl.formatMessage({id: 'supplierEvaluation.dingdanleixing'}),
dataIndex: 'orderTypeName', dataIndex: 'orderTypeName',
align: 'center', align: 'center',
}, },
{ {
title: '外部状态', title: intl.formatMessage({id: 'supplierEvaluation.waibuzhuangtai'}),
dataIndex: 'outerStatusName', dataIndex: 'outerStatusName',
align: 'center', align: 'center',
render: (text, record) => ( render: (text, record) => (
<StatusTag type="success" title="已完成" /> <StatusTag type="success" title={intl.formatMessage({id: 'supplierEvaluation.yiwancheng'})} />
), ),
}, },
{ {
title: '内部状态', title: intl.formatMessage({id: 'supplierEvaluation.neibuzhuangtai'}),
dataIndex: 'innerStatusName', dataIndex: 'innerStatusName',
align: 'center', align: 'center',
render: (text, record) => <Badge color="#41CC9E" text="已完成" />, render: (text, record) => <Badge color="#41CC9E" text={intl.formatMessage({id: 'supplierEvaluation.yiwancheng'})} />,
}, },
{ {
title: '操作', title: intl.formatMessage({id: 'supplierEvaluation.caozuo'}),
dataIndex: 'option', dataIndex: 'option',
align: 'center', align: 'center',
render: (text, record) => ( render: (text, record) => (
<> <>
<Link to={`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated/evaluate?id=${record.id}`}> <Link to={`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated/evaluate?id=${record.id}`}>
{!record.completeCommentStatus && ( {!record.completeCommentStatus && (
<Button <Button
type="link" type="link"
> >
评价 {intl.formatMessage({id: 'supplierEvaluation.pingjia'})}
</Button> </Button>
)} )}
</Link> </Link>
</> </>
), ),
}, },
]; ];
const [columns, setColumns] = useState<any[]>(defaultColumns); const [columns, setColumns] = useState<any[]>(defaultColumns);
const fetchListData = (params: any) => { const fetchListData = (params: any) => {
let { createTimeStart, createTimeEnd , ...rest } = params; let { createTimeStart, createTimeEnd , ...rest } = params;
createTimeStart = createTimeStart ? moment(+createTimeStart).format('YYYY-MM-DD HH:mm:ss') : undefined; createTimeStart = createTimeStart ? moment(+createTimeStart).format('YYYY-MM-DD HH:mm:ss') : undefined;
createTimeEnd = createTimeEnd ? moment(+createTimeEnd).format('YYYY-MM-DD HH:mm:ss') : undefined; createTimeEnd = createTimeEnd ? moment(+createTimeEnd).format('YYYY-MM-DD HH:mm:ss') : undefined;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getMemberOrderCommentVendorPage({ getMemberOrderCommentVendorPage({
createTimeStart, createTimeStart,
createTimeEnd, createTimeEnd,
...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 ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
tableProps={{ tableProps={{
rowKey: 'orderNo', rowKey: 'orderNo',
}} }}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)} fetchTableData={(params: any) => fetchListData(params)}
controlRender={ controlRender={
<NiceForm <NiceForm
actions={formActions} actions={formActions}
onSubmit={values => ref.current.reload(values)} onSubmit={values => ref.current.reload(values)}
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'orderNo', 'orderNo',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
}} }}
schema={listSearchSchema} schema={listSearchSchema}
/> />
} }
/> />
</Card> </Card>
</PageHeaderWrapper> </PageHeaderWrapper>
); );
}; };
export default Unevaluated; export default Unevaluated;
/* /*
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:35 * @Date: 2021-01-06 11:36:35
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-12 14:03:15 * @LastEditTime: 2021-08-12 14:03:15
* @Description: * @Description:
*/ */
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { GlobalConfig } from '@/global/config'; import { GlobalConfig } from '@/global/config';
import { getIntl } from 'umi';
const orderTypeArr = GlobalConfig.web.orderType.map((item) => ({ const intl = getIntl();
label: item.platformWayName, const orderTypeArr = GlobalConfig.web.orderType.map((item) => ({
value: item.id, label: item.platformWayName,
})); value: item.id,
}));
export const listSearchSchema: ISchema = {
type: 'object', export const listSearchSchema: ISchema = {
properties: { type: 'object',
megaLayout: { properties: {
type: 'object', megaLayout: {
'x-component': 'mega-layout', type: 'object',
properties: { 'x-component': 'mega-layout',
orderNo: { properties: {
type: 'string', orderNo: {
'x-component': 'Search', type: 'string',
'x-component-props': { 'x-component': 'Search',
placeholder: '搜索', 'x-component-props': {
align: 'flex-left', placeholder: intl.formatMessage({id: 'supplierEvaluation.sousuo'}),
tip: '输入 订单号 进行搜索', align: 'flex-left',
}, tip: intl.formatMessage({id: 'supplierEvaluation.shurudingdanhao'}),
}, },
[FORM_FILTER_PATH]: { },
type: 'object', [FORM_FILTER_PATH]: {
'x-component': 'mega-layout', type: 'object',
'x-component-props': { 'x-component': 'mega-layout',
grid: true, 'x-component-props': {
full: true, grid: true,
autoRow: true, full: true,
columns: 6, autoRow: true,
}, columns: 6,
properties: { },
digest: { properties: {
type: 'string', digest: {
'x-component-props': { type: 'string',
placeholder: '订单摘要', 'x-component-props': {
allowClear: true, placeholder: intl.formatMessage({id: 'supplierEvaluation.dingdanzhaiyao'}),
}, allowClear: true,
}, },
memberName: { },
type: 'string', memberName: {
default: undefined, type: 'string',
'x-component-props': { default: undefined,
placeholder: '采购会员', 'x-component-props': {
allowClear: true, placeholder: intl.formatMessage({id: 'supplierEvaluation.caigouhuiyuan'}),
}, allowClear: true,
}, },
'[createTimeStart, createTimeEnd]': { },
type: 'string', '[createTimeStart, createTimeEnd]': {
default: '', type: 'string',
'x-component': 'dateSelect', default: '',
'x-component-props': { 'x-component': 'dateSelect',
placeholder: '下单时间', 'x-component-props': {
allowClear: true, placeholder: intl.formatMessage({id: 'supplierEvaluation.xiadanshijian'}),
}, allowClear: true,
}, },
orderType: { },
type: 'string', orderType: {
default: undefined, type: 'string',
enum: orderTypeArr, default: undefined,
'x-component-props': { enum: orderTypeArr,
placeholder: '订单类型', 'x-component-props': {
allowClear: true, placeholder: intl.formatMessage({id: 'supplierEvaluation.dingdanleixing'}),
}, allowClear: true,
}, },
submit: { },
'x-component': 'Submit', submit: {
'x-mega-props': { 'x-component': 'Submit',
span: 1, 'x-mega-props': {
}, span: 1,
'x-component-props': { },
children: '查询', 'x-component-props': {
}, children: intl.formatMessage({id: 'supplierEvaluation.chaxun'}),
}, },
}, },
}, },
}, },
}, },
}, },
}; },
\ No newline at end of file };
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