Commit 255c1d1a authored by 卢均锐's avatar 卢均锐

Merge branch 'v2' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into v2

* 'v2' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform: feat: 内容能力-》资讯等国际化 feat: 采购能力 -> 在线竞价国际化 chore: 补充 returnDetailId
parents beaceaad c7d2dc6d
import React from 'react' import React from 'react'
import { Popconfirm, Button } from 'antd' import { Popconfirm, Button } from 'antd'
import { PlayCircleOutlined,PauseCircleOutlined } from '@ant-design/icons' import { PlayCircleOutlined,PauseCircleOutlined } from '@ant-design/icons'
import { useIntl } from 'umi';
export interface StatusSwitchProps { export interface StatusSwitchProps {
record: any, record: any,
...@@ -11,14 +12,15 @@ export interface StatusSwitchProps { ...@@ -11,14 +12,15 @@ export interface StatusSwitchProps {
} }
const StatusSwitch:React.FC<StatusSwitchProps> = (props) => { const StatusSwitch:React.FC<StatusSwitchProps> = (props) => {
const intl = useIntl()
const { record, fieldNames = 'status', expectTrueValue = 1 } = props const { record, fieldNames = 'status', expectTrueValue = 1 } = props
return ( return (
<Popconfirm <Popconfirm
title="确定要执行这个操作?" title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
onConfirm={props.handleConfirm} onConfirm={props.handleConfirm}
onCancel={props.handleCancel} onCancel={props.handleCancel}
okText="是" okText={intl.formatMessage({ id: 'common.button.yes' })}
cancelText="否" cancelText={intl.formatMessage({ id: 'common.button.no' })}
> >
<Button <Button
type="link" type="link"
...@@ -28,7 +30,7 @@ const StatusSwitch:React.FC<StatusSwitchProps> = (props) => { ...@@ -28,7 +30,7 @@ const StatusSwitch:React.FC<StatusSwitchProps> = (props) => {
: { color: 'red' } : { color: 'red' }
} }
> >
{record[fieldNames] === expectTrueValue ? '有效' : '无效'} {record[fieldNames] === expectTrueValue ? intl.formatMessage({ id: 'common.status.effective' }) : intl.formatMessage({ id: 'common.status.invalid' })}
{record[fieldNames] === expectTrueValue ? ( {record[fieldNames] === expectTrueValue ? (
<PlayCircleOutlined /> <PlayCircleOutlined />
) : ( ) : (
...@@ -41,4 +43,4 @@ const StatusSwitch:React.FC<StatusSwitchProps> = (props) => { ...@@ -41,4 +43,4 @@ const StatusSwitch:React.FC<StatusSwitchProps> = (props) => {
StatusSwitch.defaultProps = {} StatusSwitch.defaultProps = {}
export default StatusSwitch export default StatusSwitch
\ No newline at end of file
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
'common.form.endTime.placeholder': '结束时间', 'common.form.endTime.placeholder': '结束时间',
'common.form.activity.startTime.placeholder': '活动开始时间', 'common.form.activity.startTime.placeholder': '活动开始时间',
'common.form.activity.endTime.placeholder': '活动结束时间', 'common.form.activity.endTime.placeholder': '活动结束时间',
'common.form.input.placeholder': '请输入',
} }
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
* 内容能力 * 内容能力
*/ */
export default { export default {
'content.common.up': '上架',
'content.common.down': '下架',
'content.common.waitUp': '待上架',
'content.common.hadUp': '已上架',
'content.common.hadDown': '已下架',
'content.columns.name': '栏目名称', 'content.columns.name': '栏目名称',
'content.columns.category': '栏目分类', 'content.columns.category': '栏目分类',
'content.columns.sort': '栏目排序', 'content.columns.sort': '栏目排序',
...@@ -10,5 +16,22 @@ ...@@ -10,5 +16,22 @@
'content.columns.add': '新建栏目', 'content.columns.add': '新建栏目',
'content.columns.edit': '编辑栏目', 'content.columns.edit': '编辑栏目',
'content.category.name': '分类名称',
'content.category.type': '类型',
'content.category.recommend': '推荐分类',
'content.category.selectEditProject': '选择要编辑的项目',
'content.category.noCategoryTips': '暂无分类, 开始新增',
'content.category.handleTips': '只能同时对7个一级分类下的第三级分类设置推荐分类,且每个一级分类下最多只允许设置2个推荐分类',
'content.tag.name': '标签名称',
'content.tag.explain': '标签说明',
'content.tag.add': '新建标签',
'content.tag.edit': '编辑标签',
'content.info.title': '标题',
'content.info.column': '栏目',
'content.info.category': '分类',
'content.info.time': '发布时间',
'content.info.recommendTag': '推荐标签',
'content.info.sort': '排序',
} }
...@@ -141,6 +141,7 @@ const PurchaseLocales = { ...@@ -141,6 +141,7 @@ const PurchaseLocales = {
'detail.purchase.signUpMsgLayout': '报名信息', 'detail.purchase.signUpMsgLayout': '报名信息',
'detail.purchase.signUpFileLayout': '报名文件', 'detail.purchase.signUpFileLayout': '报名文件',
'detail.purchase.basicLayout': '基本信息', 'detail.purchase.basicLayout': '基本信息',
'detail.purchase.winBidResultLayout': '中标结果',
'detail.purchase.basicLayout1': '基本流程', 'detail.purchase.basicLayout1': '基本流程',
'detail.purchase.offerLayout': '报价信息', 'detail.purchase.offerLayout': '报价信息',
'detail.purchase.offerExplain': '报价说明', 'detail.purchase.offerExplain': '报价说明',
...@@ -193,12 +194,13 @@ const PurchaseLocales = { ...@@ -193,12 +194,13 @@ const PurchaseLocales = {
'detail.purchase.contactsMessage': '请输入联系人姓名', 'detail.purchase.contactsMessage': '请输入联系人姓名',
'detail.purchase.telPhone': '联系人手机', 'detail.purchase.telPhone': '联系人手机',
'detail.purchase.telPrefix': '请选择区号', 'detail.purchase.telPrefix': '请选择区号',
'detail.purchase.tel': '请输入你的手机号码', 'detail.purchase.tel': '请输入手机号码',
'detail.purchase.quotedDetails1': '报价摘要', 'detail.purchase.quotedDetails1': '报价摘要',
'detail.purchase.quotedPriceNo': '报价单号', 'detail.purchase.quotedPriceNo': '报价单号',
'detail.purchase.quotedMenber': '报价会员', 'detail.purchase.quotedMenber': '报价会员',
'detail.purchase.purchaseMaterial': '对应采购物料', 'detail.purchase.purchaseMaterial': '对应采购物料',
'detail.purchase.file': '附件', 'detail.purchase.file': '附件',
'detail.purchase.quotationRecordLayout': '最低报价记录',
'detail.purchase.option': '操作', 'detail.purchase.option': '操作',
'detail.purchase.demandCycle': '需求计划周期', 'detail.purchase.demandCycle': '需求计划周期',
'detail.purchase.correspondence': '对应', 'detail.purchase.correspondence': '对应',
...@@ -260,6 +262,7 @@ const PurchaseLocales = { ...@@ -260,6 +262,7 @@ const PurchaseLocales = {
'detail.purchase.seeBidStep': '查看竞价过程', 'detail.purchase.seeBidStep': '查看竞价过程',
'detail.purchase.cancelOffer': '取消报价', 'detail.purchase.cancelOffer': '取消报价',
'detail.purchase.statusBoxStatus': '当前状态', 'detail.purchase.statusBoxStatus': '当前状态',
'detail.purchase.startStill': '开始竞价',
'detail.purchase.stillRunStart': '竞价中', 'detail.purchase.stillRunStart': '竞价中',
'detail.purchase.stillRunend': '竞价结束', 'detail.purchase.stillRunend': '竞价结束',
'detail.purchase.distanceStillRunend': '距离竞价结束还剩', 'detail.purchase.distanceStillRunend': '距离竞价结束还剩',
...@@ -273,6 +276,8 @@ const PurchaseLocales = { ...@@ -273,6 +276,8 @@ const PurchaseLocales = {
'detail.purchase.offerRule4': '按项目总价排名', 'detail.purchase.offerRule4': '按项目总价排名',
'detail.purchase.offerRule5': '按项目总价排名', 'detail.purchase.offerRule5': '按项目总价排名',
'detail.purchase.null': '无', 'detail.purchase.null': '无',
'detail.purchase.thanks': '感谢函',
'detail.purchase.respect': '尊敬的',
'detail.purchase.modalTitle': '公开招标', 'detail.purchase.modalTitle': '公开招标',
'detail.purchase.modalTitle1': '选择货品', 'detail.purchase.modalTitle1': '选择货品',
...@@ -346,6 +351,11 @@ const PurchaseLocales = { ...@@ -346,6 +351,11 @@ const PurchaseLocales = {
'detail.purchase.message54': '请选择交付日期', 'detail.purchase.message54': '请选择交付日期',
'detail.purchase.message55': '请选择交付地址', 'detail.purchase.message55': '请选择交付地址',
'detail.purchase.message56': '请输入金额', 'detail.purchase.message56': '请输入金额',
'detail.purchase.message57': '请上传附件',
'detail.purchase.message58': '请输入正确格式的手机号',
'detail.purchase.message59': '请输入电子邮箱',
'detail.purchase.message60': '请输入正确格式的邮箱',
'detail.purchase.message61': '请填写详细地址',
'detail.purchase.placeholder': '选择开始日期', 'detail.purchase.placeholder': '选择开始日期',
'detail.purchase.placeholder1': '确定要执行这个操作?', 'detail.purchase.placeholder1': '确定要执行这个操作?',
...@@ -360,6 +370,9 @@ const PurchaseLocales = { ...@@ -360,6 +370,9 @@ const PurchaseLocales = {
'detail.purchase.placeholder10': '请输入目标价', 'detail.purchase.placeholder10': '请输入目标价',
'detail.purchase.placeholder11': '请输入最小价差', 'detail.purchase.placeholder11': '请输入最小价差',
'detail.purchase.placeholder12': '请输入报价次数', 'detail.purchase.placeholder12': '请输入报价次数',
'detail.purchase.placeholder13': '选择区域',
'detail.purchase.placeholder14': '请完善适用地市',
'detail.purchase.placeholder15': '请填写详细地址,路名、门牌号等,最长100个字符,50个汉字',
'detail.purchase.priceMethod': '比价方式', 'detail.purchase.priceMethod': '比价方式',
'detail.purchase.purchaseType1': '有固定采购金额', 'detail.purchase.purchaseType1': '有固定采购金额',
...@@ -387,6 +400,24 @@ const PurchaseLocales = { ...@@ -387,6 +400,24 @@ const PurchaseLocales = {
'detail.purchase.tips15': '当前报价金额不满足最小价差要求,请修改后再报价!', 'detail.purchase.tips15': '当前报价金额不满足最小价差要求,请修改后再报价!',
'detail.purchase.tips16': '当前报价次数已超过允许报价次数!', 'detail.purchase.tips16': '当前报价次数已超过允许报价次数!',
'detail.purchase.label': '中标金额(含税!',
'detail.purchase.label1': '中标理由',
'detail.purchase.label2': '价格最低',
'detail.purchase.label3': '至',
'detail.purchase.label4': '第',
'detail.purchase.label5': '名',
'detail.purchase.label6': '次',
'detail.purchase.label7': '不公开',
'detail.purchase.label8': '第一名',
'detail.purchase.label9': '第二名',
'detail.purchase.label10': '第三名',
'detail.purchase.label11': '报价历史',
'detail.purchase.label12': '本次报价金额',
'detail.purchase.label13': '最近报价',
'detail.purchase.label14': '报名',
'detail.purchase.label15': '重新报名',
'detail.purchase.label16': '报名要求说明',
'detail.purchase.label17': '地址',
} }
export default PurchaseLocales export default PurchaseLocales
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-08-13 18:19:27 * @Date: 2021-08-13 18:19:27
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-17 20:06:40 * @LastEditTime: 2021-12-01 16:59:06
* @Description: 新增退货入库单 * @Description: 新增退货入库单
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -46,6 +46,7 @@ const ReturnAddWarehouseBill = () => { ...@@ -46,6 +46,7 @@ const ReturnAddWarehouseBill = () => {
relatedCount: item.returnCount, relatedCount: item.returnCount,
billCount: item.returnDeliveryCount, billCount: item.returnDeliveryCount,
count: item.returnDeliveryCount, count: item.returnDeliveryCount,
billDetailId: item.returnDetailId,
})), })),
orderType: res.data.orderType, orderType: res.data.orderType,
}); });
...@@ -74,6 +75,7 @@ const ReturnAddWarehouseBill = () => { ...@@ -74,6 +75,7 @@ const ReturnAddWarehouseBill = () => {
brand: item.brand, brand: item.brand,
unit: item.unit, unit: item.unit,
count: item.count, count: item.count,
returnDetailId: item.billDetailId,
})), })),
}).then((res) => { }).then((res) => {
if (res.code === 1000) { if (res.code === 1000) {
......
import React, { useState, useEffect, useMemo } from 'react' import React, { useEffect, useMemo } from 'react'
import { Row, Col, Popconfirm, Button, Card, Tooltip } from 'antd'; import { Popconfirm, Button, Card, Tooltip } from 'antd';
import Children from '@/components/NiceForm/components/Children'; import TabTree, { createTreeActions } from '@/components/TabTree';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { createFormActions, FormButtonGroup } from '@formily/antd';
import TabTree, { useTreeActions, createTreeActions } from '@/components/TabTree'; import { Checkbox } from '@formily/antd-components';
import SchemaForm, { createFormActions, LifeCycleTypes, FormEffectHooks, FormButtonGroup } from '@formily/antd'; import { useIntl } from 'umi';
import { Checkbox } from '@formily/antd-components' import { classSchema } from './schema';
import { classSchema } from './schema'
import { useTreeTabs } from '@/hooks/useTreeTabs'; import { useTreeTabs } from '@/hooks/useTreeTabs';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import styles from './index.less'; import styles from './index.less';
import { BorderOuterOutlined, QuestionCircleOutlined } from '@ant-design/icons'; import { QuestionCircleOutlined } from '@ant-design/icons';
import { getManageMemberCategoryAll, getManageMemberCategoryGet, postManageMemberCategoryAdd, postManageMemberCategoryDelete, postManageMemberCategoryUpdate } from '@/services/ManageV2Api'; import { getManageMemberCategoryAll, getManageMemberCategoryGet, postManageMemberCategoryAdd, postManageMemberCategoryDelete, postManageMemberCategoryUpdate } from '@/services/ManageV2Api';
const { ON_FORM_INPUT_CHANGE } = LifeCycleTypes
enum FormState { enum FormState {
FREE, // 空闲状态 FREE, // 空闲状态
EDIT, // 编辑状态 EDIT, // 编辑状态
...@@ -69,6 +66,7 @@ const fetchClassTreeData = async (params?) => { ...@@ -69,6 +66,7 @@ const fetchClassTreeData = async (params?) => {
const ClassProperty: React.FC<{}> = () => { const ClassProperty: React.FC<{}> = () => {
const intl = useIntl()
const { const {
treeStatus, treeStatus,
setTreeStatus, setTreeStatus,
...@@ -164,7 +162,7 @@ const ClassProperty: React.FC<{}> = () => { ...@@ -164,7 +162,7 @@ const ClassProperty: React.FC<{}> = () => {
<div className={styles.page}> <div className={styles.page}>
<div className={styles.tree}> <div className={styles.tree}>
<Card> <Card>
<h3 className="mb-30">选择要编辑的项目</h3> <h3 className="mb-30">{intl.formatMessage({ id: 'content.category.selectEditProject' })}</h3>
{ {
treeData && treeData.length > 0 treeData && treeData.length > 0
? <TabTree ? <TabTree
...@@ -176,14 +174,14 @@ const ClassProperty: React.FC<{}> = () => { ...@@ -176,14 +174,14 @@ const ClassProperty: React.FC<{}> = () => {
customKey="id" customKey="id"
/> />
: :
<Button block type='primary' onClick={() => handleSelect()}>暂无菜单, 开始新增</Button> <Button block type='primary' onClick={() => handleSelect()}>{intl.formatMessage({ id: 'content.category.noCategoryTips' })}</Button>
} }
</Card> </Card>
</div> </div>
<div className={styles.editPanel}> <div className={styles.editPanel}>
{ {
treeStatus !== FormState.FREE && <> treeStatus !== FormState.FREE && <>
<h3 className="commonPanelTitle mb-30">{treeStatus === FormState.ADD ? '新增' : '编辑'}</h3> <h3 className="commonPanelTitle mb-30">{intl.formatMessage({ id: treeStatus === FormState.ADD ? 'common.button.add' : 'common.button.edit' })}</h3>
<NiceForm <NiceForm
value={formValue} value={formValue}
components={{ components={{
...@@ -194,10 +192,10 @@ const ClassProperty: React.FC<{}> = () => { ...@@ -194,10 +192,10 @@ const ClassProperty: React.FC<{}> = () => {
onSubmit={onFinish} onSubmit={onFinish}
actions={formActions} actions={formActions}
effects={($, action)=> {}} effects={($, action)=> {}}
schema={classSchema} schema={classSchema()}
expressionScope={{ expressionScope={{
showWarn: ( showWarn: (
<Tooltip placement="topLeft" title={"只能同时对7个一级分类下的第三级分类设置推荐分类,且每个一级分类下最多只允许设置2个推荐分类"}> <Tooltip placement="topLeft" title={intl.formatMessage({ id: 'content.category.handleTips' })}>
<span style={{marginTop: '-12px', width: '50px'}}> <span style={{marginTop: '-12px', width: '50px'}}>
<QuestionCircleOutlined /> <QuestionCircleOutlined />
</span> </span>
...@@ -207,12 +205,17 @@ const ClassProperty: React.FC<{}> = () => { ...@@ -207,12 +205,17 @@ const ClassProperty: React.FC<{}> = () => {
> >
<FormButtonGroup> <FormButtonGroup>
<Button htmlType='submit' type="primary" > <Button htmlType='submit' type="primary" >
保存 {intl.formatMessage({ id: 'common.button.save' })}
</Button> </Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={handleDeleteMenu}> <Popconfirm
title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
okText={intl.formatMessage({ id: 'common.button.yes' })}
cancelText={intl.formatMessage({ id: 'common.button.no' })}
onConfirm={handleDeleteMenu}
>
{ {
treeStatus !== FormState.ADD && <Button > treeStatus !== FormState.ADD && <Button >
删除 {intl.formatMessage({ id: 'common.button.delete' })}
</Button> </Button>
} }
</Popconfirm> </Popconfirm>
......
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { useIntl } from 'umi';
export const classSchema: ISchema = { export const classSchema = (): ISchema => {
type: 'object', const intl = useIntl()
properties: {
megaLayout: { return {
type: 'object', type: 'object',
"x-component": "mega-layout", properties: {
"x-component-props": { megaLayout: {
grid: true, type: 'object',
columns: 16, "x-component": "mega-layout",
labelAlign: 'top' "x-component-props": {
}, grid: true,
properties: { columns: 16,
noField1: { labelAlign: 'top'
type: 'object', },
"x-component": 'mega-layout', properties: {
"x-component-props": { noField1: {
full: true, type: 'object',
"wrapperWidth": 507, "x-component": 'mega-layout',
}, "x-component-props": {
"x-mega-props": { full: true,
span: 1 "wrapperWidth": 507,
},
properties: {
name: {
type: 'string',
title: '分类名称',
required: true,
"x-component-props": {
placeholder: '请输入分类名称'
},
"x-rules": [
{
limitByte: true,
maxByte: 20
}
]
}, },
describe: { "x-mega-props": {
type: 'textarea', span: 1
title: '类型',
"x-component-props": {
placeholder: '最多100个字符,50个汉字'
},
"x-rules": [
{
limitByte: true,
maxByte: 100
}
]
}, },
level: { properties: {
type: 'string', name: {
visible: false, type: 'string',
'x-linkages': [ title: intl.formatMessage({ id: 'content.category.name' }),
{ required: true,
type: 'value:visible', "x-component-props": {
target: '*(inlineLayout)', placeholder: `${intl.formatMessage({ id: 'common.form.input.placeholder' })}${intl.formatMessage({ id: 'content.category.name' })}`
condition: '{{$value === 3}}'
}, },
] "x-rules": [
}, {
inlineLayout: { limitByte: true,
type: 'object', maxByte: 20
"x-component": "mega-layout", }
"x-component-props": { ]
inline: true,
}, },
properties: { describe: {
status: { type: 'textarea',
title: '', title: intl.formatMessage({ id: 'content.category.type' }),
'x-component': 'CheckboxGroup', "x-component-props": {
enum: [ placeholder: `100${intl.formatMessage({ id: 'common.unit.individual.character' })},50${intl.formatMessage({ id: 'common.unit.individual.chinese' })}`
{ label: '推荐分类', value: 1 }, },
], "x-rules": [
"x-mega-props": { {
"addonAfter": "{{showWarn}}", limitByte: true,
// wrapperWidth: 130 maxByte: 100
}
]
},
level: {
type: 'string',
visible: false,
'x-linkages': [
{
type: 'value:visible',
target: '*(inlineLayout)',
condition: '{{$value === 3}}'
}, },
]
},
inlineLayout: {
type: 'object',
"x-component": "mega-layout",
"x-component-props": {
inline: true,
}, },
properties: {
status: {
title: '',
'x-component': 'CheckboxGroup',
enum: [
{ label: intl.formatMessage({ id: 'content.category.recommend' }), value: 1 },
],
"x-mega-props": {
"addonAfter": "{{showWarn}}",
// wrapperWidth: 130
},
},
}
} }
}
// status1: { // status1: {
// title: '', // title: '',
// 'x-component': 'Children', // 'x-component': 'Children',
// "x-component-props": { // "x-component-props": {
// "children": "{{renderCheckBox()}}" // "children": "{{renderCheckBox()}}"
// } // }
// } // }
} }
}, },
}
} }
} }
} }
......
import React, { useEffect, useState, useRef } from 'react'; import React, { useRef } from 'react';
import { Card, Button, Popconfirm, Row, Col } from 'antd'; import { Card, Button, Popconfirm, Row, Col } from 'antd';
import { createFormActions, ISchema } from '@formily/antd'; import { createFormActions, ISchema } from '@formily/antd';
import { history, useIntl } from 'umi'; import { history, useIntl } from 'umi';
...@@ -6,7 +6,6 @@ import StatusSwitch from '@/components/StatusSwitch'; ...@@ -6,7 +6,6 @@ import StatusSwitch from '@/components/StatusSwitch';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PlusOutlined } from '@ant-design/icons' import { PlusOutlined } from '@ant-design/icons'
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import { getTableDataSource } from '../utils/utils';
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import EyePreview from '@/components/EyePreview' import EyePreview from '@/components/EyePreview'
...@@ -15,12 +14,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte ...@@ -15,12 +14,6 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { getManageMemberColumnPage, postManageMemberColumnDelete, postManageMemberColumnUpdateStatus } from '@/services/ManageV2Api'; import { getManageMemberColumnPage, postManageMemberColumnDelete, postManageMemberColumnUpdateStatus } from '@/services/ManageV2Api';
const formActions = createFormActions(); const formActions = createFormActions();
const actions = createFormActions();
const getData = async (params) => {
const res = await getManageMemberColumnPage(params)
return res.data
}
const columnList: React.FC<{}> = () => { const columnList: React.FC<{}> = () => {
......
import React from 'react';
import EyePreview from '@/components/EyePreview';
const columns = [
{title: 'ID', dataIndex: 'id'},
{
title: '栏目名称', dataIndex: 'name',
render: (text: string, record: any) => (
<EyePreview
url={`/memberCenter/contentAbility/columnsManagement/detail?id=${record.id}&preview=1`}
>
{text}
</EyePreview>
)
},
{title: '栏目分类', dataIndex: 'type', render: (text) => text === 1 ? '市场行情' : '资讯'},
{title: '栏目排序', dataIndex: 'sort'},
{
title: '状态', dataIndex: 'status',
filters: [
{
text: '有效',
value: 1,
},
{
text: '无效',
value: 0,
},
],
onFilter: (value, record) => record.status === value,
render: "{{renderStatus}}"
},
{title: '操作', render: "{{renderOperation}}"}
];
const schema = {
type: 'object',
properties: {
layout: {
type: 'object',
// 'x-component': 'mega-layout',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'space-between'
},
properties: {
createBtn: {
type: "object",
name: "createBtn",
"x-component": "button",
"x-component-props": {
"onClick": "{{goToCreate}}",
"children": "新建",
"type": 'primary'
}
},
'right-layout': {
type: 'object',
name: 'rigth-layout',
"x-component": 'CustomFlexRowLayout',
"x-component-props": {
justify: 'center'
},
properties: {
search: {
type: 'string',
name: 'search',
'x-component': 'CustomSearch',
'x-component-props': {
placeholder: "请填写栏目名称",
"onSearch": "{{search}}",
}
},
searchBtn: {
type: 'string',
name: 'searchBtn',
"x-component": "button",
"x-component-props": {
"onClick": "{{reset}}",
"children": "重置",
style: {
marginLeft: '15px'
}
}
},
}
}
}
},
"table": {
"key": "table",
"type": "object",
"name": "table",
"x-component": "SchemaTable",
"x-component-props": {
"columns": columns,
"rowKey": "id",
"pagination": false
}
},
pagination: {
type: 'object',
'x-component': "TablePagination",
'x-style': {
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end'
},
'x-component-props': {
showQuickJumper: true,
pageSize: 10,
size: 'small'
}
}
}
}
export default schema
This diff is collapsed.
import React, {useState, useEffect} from 'react'; import React, { useRef } from 'react';
import { Card, Input, Button, Table, Space, Popconfirm } from 'antd'; import { Card, Button, Popconfirm, Row, Col } from 'antd';
import { FilterTable, SchemaFlexRowLayout } from '../components/FilterTable'; import EyePreview from '@/components/EyePreview';
import { createVirtualBox, createFormActions, FormEffectHooks, createEffectHook } from '@formily/antd'; import NiceForm from '@/components/NiceForm';
import { history, Link } from 'umi'; import { ColumnType } from 'antd/lib/table/interface'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { createFormActions } from '@formily/antd';
import { history, useIntl } from 'umi';
import StatusSwitch from '@/components/StatusSwitch'; import StatusSwitch from '@/components/StatusSwitch';
import tagsManagementSchema from './schema'; import { StandardTable } from 'god';
import TablePagination from '../components/TablePagination'; import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { getTableDataSource } from '../utils/utils';
import CustomSearch from '../components/CustomSearch';
import { getManageMemberLabelPage, postManageMemberLabelDelete, postManageMemberLabelUpdateStatus } from '@/services/ManageV2Api'; import { getManageMemberLabelPage, postManageMemberLabelDelete, postManageMemberLabelUpdateStatus } from '@/services/ManageV2Api';
const { onFieldValueChange$ } = FormEffectHooks
const { Search } = Input;
const SchemaButton = createVirtualBox('button', Button);
const SchemaTable = createVirtualBox('SchemaTable', Table);
const actions = createFormActions(); const actions = createFormActions();
const getData = async (params) => {
const res = await getManageMemberLabelPage(params)
return res.data
}
const Tags = () => { const Tags = () => {
const tagEffects = () => () => { const intl = useIntl()
onFieldValueChange$('pagination').subscribe((state) => { const ref = useRef<any>({})
handleSearch({...state.value})
})
}
useEffect(() => { const columns: ColumnType<any>[] = [
const params = { {title: 'ID', dataIndex: 'id'},
current: 1, {
pageSize: 10 title: intl.formatMessage({ id: 'content.tag.name' }), dataIndex: 'name',
render: (text: string, record: any) => (
<EyePreview
url={`/memberCenter/contentAbility/tagsManagement/detail?id=${record.id}&preview=1`}
>
{text}
</EyePreview>
)
},
{
title: intl.formatMessage({ id: 'content.tag.explain' }),
dataIndex: 'explain'
},
{
title: intl.formatMessage({ id: 'common.table.status' }),
align: 'center',
dataIndex: 'status',
key: 'status',
render: (text: any, record: any) => (
<StatusSwitch
fieldNames="status"
handleConfirm={() => handleModify(record)}
record={record}
/>
)
},
{
title: intl.formatMessage({ id: 'common.table.action' }),
align: 'center',
key: 'operate',
dataIndex: 'operate',
render: (_, record) => !record.status && (
<>
<Button type='link' onClick={() => history.push(`/memberCenter/contentAbility/tagsManagement/detail?id=${record.id}`)}>{intl.formatMessage({ id: 'common.button.modify' })}</Button>
<Popconfirm
title={intl.formatMessage({ id: 'common.tip.option.confirm' })}
onConfirm={() => handleRemove(record.id)}
>
<Button type='link'>{intl.formatMessage({ id: 'common.button.delete' })}</Button>
</Popconfirm>
</>
)
} }
getTableDataSource(actions, params, getData); ];
}, [])
const schema = {
type: 'object',
properties: {
megalayout: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
grid: true
},
properties: {
ctl: {
type: 'object',
"x-component": "Children",
"x-component-props": {
children: "{{controllerBtns}}"
}
},
name: {
type: 'string',
"x-component": "Search",
"x-mega-props": {
},
"x-component-props": {
placeholder: intl.formatMessage({ id: 'content.tag.name' }),
advanced: false
}
}
}
}
}
}
// 获取列表
const fetchData = (params: any) => {
return new Promise((resolve) => {
getManageMemberLabelPage(params).then(res => {
resolve(res.data)
})
})
}
// 修改状态 // 修改状态
const handleModify = (value) => { const handleModify = (value) => {
...@@ -44,94 +114,54 @@ const Tags = () => { ...@@ -44,94 +114,54 @@ const Tags = () => {
id: id, id: id,
enableStatus: (status ^ 1), enableStatus: (status ^ 1),
} }
postManageMemberLabelUpdateStatus(postData). postManageMemberLabelUpdateStatus(postData).then((res) => {
then((data) => { if (res.code === 1000) {
const paginationValue = actions.getFieldValue('pagination'); ref.current.reload()
handleSearch({...paginationValue}) }
}) })
} }
// 栏目删除 // 栏目删除
const handleRemove = (id: number) => { const handleRemove = (id: number) => {
///manage/contentColumn/delete ///manage/contentColumn/delete
postManageMemberLabelDelete({id: id}) postManageMemberLabelDelete({id: id}).then((res) => {
.then(async (data) => { if (res.code === 1000) {
const paginationValue = actions.getFieldValue('pagination'); ref.current.reload()
handleSearch({...paginationValue}) }
}) })
} }
const handleSearch = async (params) => { const controllerBtns = <Row>
const title = actions.getFieldValue('search'); <Col span={6}>
const postData = { <Button
name: title || '', onClick={() => history.push('/memberCenter/contentAbility/tagsManagement/add')}
current: 1, type="primary"
pageSize: 10, >
...params, {intl.formatMessage({ id: 'common.button.add' })}
} </Button>
getTableDataSource(actions, postData, getData); </Col>
} </Row>
// 重设页码
const resetPagination = (params) => {
const paginationValue = actions.getFieldValue('pagination');
actions.setFieldValue('pagination', {
...paginationValue,
...params
})
}
return ( return (
<div> <div>
<Card> <Card>
<FilterTable <StandardTable
effects={tagEffects()} tableProps={{ rowKey: 'id' }}
schema={tagsManagementSchema} columns={columns}
components={{CustomSearch, TablePagination}} currentRef={ref}
actions={actions} fetchTableData={(params: any) => fetchData(params)}
expressionScope={{ controlRender={
goToCreate: () => { <NiceForm
history.push(`/memberCenter/contentAbility/tagsManagement/add`) actions={actions}
}, expressionScope={{ controllerBtns }}
search: (value) => { onSubmit={values => ref.current.reload(values)}
resetPagination({current: 1}) effects={($, actions) => {
handleSearch({title: value, current: 1 }); useStateFilterSearchLinkageEffect($, actions, 'title', FORM_FILTER_PATH)
}, }}
renderOperation: (val, record) => { schema={schema}
return ( >
<Space> </NiceForm>
{ }
record.status === 0
? <>
<Link to={`/memberCenter/contentAbility/tagsManagement/detail?id=${record.id}`}>编辑</Link>
<Popconfirm
title="确定要执行这个操作?"
onConfirm={() => handleRemove(record.id)}
okText="是"
cancelText="否"
>
<a>删除</a>
</Popconfirm>
</>
: null
}
</Space>
)
},
renderStatus: (text, record) => {
return (
<StatusSwitch
handleConfirm={() => handleModify(record)}
record={record}
fieldNames="status"
/>
)
},
reset: () => {
actions.setFieldValue('search');
resetPagination({current: 1})
handleSearch({current: 1})
},
}}
/> />
</Card> </Card>
</div> </div>
......
import React from 'react';
import EyePreview from '@/components/EyePreview';
const columns = [
{title: 'ID', dataIndex: 'id'},
{
title: '标签名称', dataIndex: 'name',
render: (text: string, record: any) => (
<EyePreview
url={`/memberCenter/contentAbility/tagsManagement/detail?id=${record.id}&preview=1`}
>
{text}
</EyePreview>
)
},
{title: '标签说明', dataIndex: 'explain'},
{title: '状态', dataIndex: 'status', render: "{{renderStatus}}", width: 120},
{title: '操作', render: "{{renderOperation}}", width: 150}
];
const schema = {
type: 'object',
properties: {
layout: {
type: 'object',
// 'x-component': 'mega-layout',
'x-component': 'CustomFlexRowLayout',
'x-component-props': {
justify: 'space-between'
},
properties: {
createBtn: {
type: "object",
name: "createBtn",
"x-component": "button",
"x-component-props": {
"onClick": "{{goToCreate}}",
"children": "新建",
"type": 'primary'
}
},
'right-layout': {
type: 'object',
name: 'rigth-layout',
"x-component": 'CustomFlexRowLayout',
"x-component-props": {
justify: 'center'
},
properties: {
search: {
type: 'string',
name: 'search',
'x-component': 'CustomSearch',
'x-component-props': {
placeholder: "请填写标签名称",
"onSearch": "{{search}}",
}
},
searchBtn: {
type: 'string',
name: 'searchBtn',
"x-component": "button",
"x-component-props": {
"onClick": "{{reset}}",
"children": "重置",
style: {
marginLeft: '15px'
}
}
},
}
}
}
},
"table": {
"key": "table",
"type": "object",
"name": "table",
"x-component": "SchemaTable",
"x-component-props": {
"dataSource": [],
"columns": columns,
"rowKey": "id",
"pagination": false
}
},
pagination: {
type: 'object',
'x-component': "TablePagination",
'x-style': {
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end'
},
'x-component-props': {
showQuickJumper: true,
pageSize: 10,
size: 'small'
}
}
}
}
export default schema;
...@@ -4,70 +4,71 @@ import { Card, Select, Input, Button } from 'antd'; ...@@ -4,70 +4,71 @@ import { Card, Select, Input, Button } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import { history, Prompt } from 'umi'; import { history, Prompt, useIntl } from 'umi';
import { useInitialValues } from '../hooks/useInitialValues'; import { useInitialValues } from '../hooks/useInitialValues';
import useCustomValidator from '../hooks/useValidator' import useCustomValidator from '../hooks/useValidator'
import { getManageMemberLabelGet, postManageMemberLabelAdd, postManageMemberLabelUpdate } from '@/services/ManageV2Api'; import { getManageMemberLabelGet, postManageMemberLabelAdd, postManageMemberLabelUpdate } from '@/services/ManageV2Api';
const { TextArea } = Input; const { TextArea } = Input;
const schema = {
type: 'object',
properties: {
layout: {
name: 'layout',
type: 'boject',
'x-component': 'mega-layout',
'x-component-props': {
"labelCol": 3,
"wrapperCol": 10,
"labelAlign": "left"
},
properties: {
name: {
name: 'name',
title: '标签名称',
'x-component': 'Input',
"required": true,
"x-rules": [
{
"required": true,
"message": "请填写标签名称"
},
{
limitByte: true, // 自定义校验规则
maxByte: 20,
}
],
},
explain: {
name: 'explain',
title: '标签说明',
'x-component': 'TextArea',
'x-component-props': {
rows: 5
},
"x-rules": [
{
limitByte: true, // 自定义校验规则
maxByte: 80,
}
],
},
}
}
}
}
const TagInfo = () => { const TagInfo = () => {
useCustomValidator(); useCustomValidator();
const intl = useIntl()
const { id, preview } = usePageStatus(); const { id, preview } = usePageStatus();
const [ submitLoading, setSubmitLoading ] = useState(false); const [ submitLoading, setSubmitLoading ] = useState(false);
const initialValues = useInitialValues({id:id}, getManageMemberLabelGet); const initialValues = useInitialValues({id:id}, getManageMemberLabelGet);
const isEdit = id && !preview; const isEdit = id && !preview;
const isAdd = !id && !preview; const isAdd = !id && !preview;
const [unsaved, setUnsaved] = useState(true); const [unsaved, setUnsaved] = useState(true);
const schema = {
type: 'object',
properties: {
layout: {
name: 'layout',
type: 'boject',
'x-component': 'mega-layout',
'x-component-props': {
"labelCol": 3,
"wrapperCol": 10,
"labelAlign": "left"
},
properties: {
name: {
name: 'name',
title: intl.formatMessage({ id: 'content.tag.name' }),
'x-component': 'Input',
"required": true,
"x-rules": [
{
"required": true,
"message": `${intl.formatMessage({ id: 'common.form.input.placeholder' })}${intl.formatMessage({ id: 'content.tag.name' })}`
},
{
limitByte: true, // 自定义校验规则
maxByte: 20,
}
],
},
explain: {
name: 'explain',
title: intl.formatMessage({ id: 'content.tag.explain' }),
'x-component': 'TextArea',
'x-component-props': {
rows: 5
},
"x-rules": [
{
limitByte: true, // 自定义校验规则
maxByte: 80,
}
],
},
}
}
}
}
const handleSubmit = (value) => { const handleSubmit = (value) => {
console.log(value) console.log(value)
const { id, name, explain} = value; const { id, name, explain} = value;
...@@ -90,12 +91,13 @@ const TagInfo = () => { ...@@ -90,12 +91,13 @@ const TagInfo = () => {
const handleCancel = () => { const handleCancel = () => {
history.push('/memberCenter/contentAbility/tagsManagement') history.push('/memberCenter/contentAbility/tagsManagement')
} }
return ( return (
<div> <div>
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />} backIcon={<ReutrnEle description={intl.formatMessage({ id: 'common.button.back' })} />}
title={!id ? '新建标签' : '编辑标签'} title={!id ? intl.formatMessage({ id: 'content.tag.add' }) : intl.formatMessage({ id: 'content.tag.edit' })}
> >
<Card> <Card>
<SchemaForm <SchemaForm
...@@ -109,15 +111,15 @@ const TagInfo = () => { ...@@ -109,15 +111,15 @@ const TagInfo = () => {
isAdd || isEdit isAdd || isEdit
? ( ? (
<FormButtonGroup offset={3}> <FormButtonGroup offset={3}>
<Submit loading={submitLoading}>提交</Submit> <Submit loading={submitLoading}>{intl.formatMessage({ id: 'common.button.submit' })}</Submit>
<Button onClick={handleCancel}>取消</Button> <Button onClick={handleCancel}>{intl.formatMessage({ id: 'common.button.cancel' })}</Button>
</FormButtonGroup> </FormButtonGroup>
) )
: <></> : <></>
} }
</SchemaForm> </SchemaForm>
</Card> </Card>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" /> <Prompt when={unsaved} message={intl.formatMessage({ id: 'common.tip.save.confirm' })} />
</PageHeaderWrapper> </PageHeaderWrapper>
</div> </div>
) )
......
...@@ -4,8 +4,11 @@ import moment from 'moment'; ...@@ -4,8 +4,11 @@ import moment from 'moment';
import { getAuth } from '@/utils/auth'; import { getAuth } from '@/utils/auth';
import style from './index.less' import style from './index.less'
import { getIntl } from 'umi';
const intl = getIntl();
interface ThankItemProps { interface ThankItemProps {
visible: boolean, visible: boolean,
detail: any, detail: any,
...@@ -17,7 +20,7 @@ const ThankItem: React.FC<ThankItemProps> = (props: any) => { ...@@ -17,7 +20,7 @@ const ThankItem: React.FC<ThankItemProps> = (props: any) => {
const userInfo = useMemo(() => getAuth(), [detail]); const userInfo = useMemo(() => getAuth(), [detail]);
return ( return (
<Modal <Modal
title="感谢函" title={intl.formatMessage({ id: 'detail.purchase.thanks' })}
visible={visible} visible={visible}
onOk={onOk} onOk={onOk}
onCancel={onOk} onCancel={onOk}
...@@ -25,9 +28,9 @@ const ThankItem: React.FC<ThankItemProps> = (props: any) => { ...@@ -25,9 +28,9 @@ const ThankItem: React.FC<ThankItemProps> = (props: any) => {
className={style.thankModal} className={style.thankModal}
> >
<div className={style.thankLetter}> <div className={style.thankLetter}>
<h2>感谢函</h2> <h2>{intl.formatMessage({ id: 'detail.purchase.thanks' })}</h2>
<h4>THANKS LETTER</h4> <h4>THANKS LETTER</h4>
<p className={style.name}>尊敬的{userInfo.name}</p> <p className={style.name}>{intl.formatMessage({ id: 'detail.purchase.respect' })}{userInfo.name}</p>
<p>{detail.content}</p> <p>{detail.content}</p>
<p className={style.company}>{detail.createMemberName}</p> <p className={style.company}>{detail.createMemberName}</p>
<p className={style.time}>{moment().format('YYYY-MM-DD')}</p> <p className={style.time}>{moment().format('YYYY-MM-DD')}</p>
...@@ -36,4 +39,4 @@ const ThankItem: React.FC<ThankItemProps> = (props: any) => { ...@@ -36,4 +39,4 @@ const ThankItem: React.FC<ThankItemProps> = (props: any) => {
) )
} }
export default ThankItem; export default ThankItem;
\ No newline at end of file
...@@ -11,58 +11,61 @@ import TrendTag from '../../../../components/detail/components/trendTag'; ...@@ -11,58 +11,61 @@ import TrendTag from '../../../../components/detail/components/trendTag';
import styles from './index.less'; import styles from './index.less';
import OfferItem from '../offer'; import OfferItem from '../offer';
import { getIntl } from 'umi';
const intl = getIntl();
interface HistoryItemProps { interface HistoryItemProps {
detail: any detail: any
} }
const HistoryItem: React.FC<HistoryItemProps> = (props: any) => { const HistoryItem: React.FC<HistoryItemProps> = (props: any) => {
const { detail } = props; const { detail } = props;
const mapData = detail.offerLogs ? [...detail.offerLogs].splice(0, 3) : []; const mapData = detail.offerLogs ? [...detail.offerLogs].splice(0, 3) : [];
const firstData = mapData[0]; const firstData = mapData[0];
const _returnBadge = () => { const _returnBadge = () => {
if (!detail.isOpenRanking) { if (!detail.isOpenRanking) {
return null; return null;
} else { } else {
const _number = Number(detail?.ranking ?? 0); const _number = Number(detail?.ranking ?? 0);
switch (_number) { switch (_number) {
case 1: case 1:
return <img src={level1} alt="第一名" className={styles.icon} />; return <img src={level1} alt={intl.formatMessage({ id: 'detail.purchase.label8' })} className={styles.icon} />;
case 2: case 2:
return <img src={level2} alt="第二名" className={styles.icon} />; return <img src={level2} alt={intl.formatMessage({ id: 'detail.purchase.label9' })} className={styles.icon} />;
case 3: case 3:
return <img src={level3} alt="第三名" className={styles.icon} />; return <img src={level3} alt={intl.formatMessage({ id: 'detail.purchase.label10' })}className={styles.icon} />;
default: default:
return <div className={styles.badge}>{_number}</div> return <div className={styles.badge}>{_number}</div>
} }
}
} }
}
return ( return (
<div className={styles.history}> <div className={styles.history}>
<div className={styles.historyHeader}> <div className={styles.historyHeader}>
<h5>报价历史</h5> <h5>{intl.formatMessage({ id: 'detail.purchase.label11' })}</h5>
<div className={styles.box}> <div className={styles.box}>
{_returnBadge()} {_returnBadge()}
<div className={styles.rightPosition}> <div className={styles.rightPosition}>
{firstData?.offerRatio ? <TrendTag ratio={firstData?.offerRatio} /> : ''} {firstData?.offerRatio ? <TrendTag ratio={firstData?.offerRatio} /> : ''}
</div> </div>
<p>本次报价金额</p> <p>{intl.formatMessage({ id: 'detail.purchase.label12' })}</p>
<p className={styles.currentPrice}><span>¥</span>{firstData?.offerPrice ? priceFormat(firstData?.offerPrice) : '-'}</p> <p className={styles.currentPrice}><span>¥</span>{firstData?.offerPrice ? priceFormat(firstData?.offerPrice) : '-'}</p>
<div className={styles.row}> <div className={styles.row}>
<div className={styles.col} style={{ borderRight: '1px solid #EBECF0' }}>当前最低价:<span>{detail.isOpenPurchase ? (detail?.minLowPrice ? `¥${priceFormat(detail?.minLowPrice)}` : '-') : '不公开'}</span></div> <div className={styles.col} style={{ borderRight: '1px solid #EBECF0' }}>{intl.formatMessage({ id: 'detail.purchase.nowMinPrice1' })}<span>{detail.isOpenPurchase ? (detail?.minLowPrice ? `¥${priceFormat(detail?.minLowPrice)}` : '-') : '不公开'}</span></div>
<div className={styles.col}>报价次数:<span>{firstData?.offerCount ? firstData?.offerCount : '-'}</span></div> <div className={styles.col}>{intl.formatMessage({ id: 'detail.purchase.allowPurchaseCount1' })}<span>{firstData?.offerCount ? firstData?.offerCount : '-'}</span></div>
</div> </div>
</div>
</div>
<div className={styles.historyFootter}>
<h5>最近报价</h5>
{mapData && mapData.map((item) => {
return (<OfferItem key={item.offerTime} detail={{ ...item, isOpenRanking: detail.isOpenRanking, isOpenPurchase: detail.isOpenPurchase }} />)
})}
</div>
</div> </div>
) </div>
<div className={styles.historyFootter}>
<h5>{intl.formatMessage({ id: 'detail.purchase.label13' })}</h5>
{mapData && mapData.map((item) => {
return (<OfferItem key={item.offerTime} detail={{ ...item, isOpenRanking: detail.isOpenRanking, isOpenPurchase: detail.isOpenPurchase }} />)
})}
</div>
</div>
)
} }
export default HistoryItem; export default HistoryItem;
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { history } from 'umi'; import { getIntl, history } from 'umi';
import { Row, Col } from 'antd'; import { Row, Col } from 'antd';
import { ArrowLeftOutlined } from '@ant-design/icons'; import { ArrowLeftOutlined } from '@ant-design/icons';
import { isEmpty } from 'lodash' import { isEmpty } from 'lodash'
...@@ -18,114 +18,116 @@ import IMBtn from '../../../components/detail/components/iMBtn'; ...@@ -18,114 +18,116 @@ import IMBtn from '../../../components/detail/components/iMBtn';
import HistoryItem from './history'; import HistoryItem from './history';
const intl = getIntl();
import styles from './index.less'; import styles from './index.less';
const Detail = () => { const Detail = () => {
const { purchaseBidStore } = usePurchaseBidStore(); const { purchaseBidStore } = usePurchaseBidStore();
const { purchaseBiddingMessageSupplier } = purchaseBidStore; const { purchaseBiddingMessageSupplier } = purchaseBidStore;
const { const {
query: { query: {
id, id,
number, number,
onlineId onlineId
}, },
pathname, pathname,
} = history.location; } = history.location;
const [dataSource, setDataSource] = useState<any>({}); const [dataSource, setDataSource] = useState<any>({});
const [chartsList, setChartsList] = useState<any>([]); const [chartsList, setChartsList] = useState<any>([]);
useEffect(() => { useEffect(() => {
const _data = purchaseBiddingMessageSupplier?.data const _data = purchaseBiddingMessageSupplier?.data
if (purchaseBiddingMessageSupplier && !isEmpty(dataSource) && _data.id == onlineId) { if (purchaseBiddingMessageSupplier && !isEmpty(dataSource) && _data.id == onlineId) {
const _obj = { const _obj = {
ranking: _data.ranking, ranking: _data.ranking,
minLowPrice: _data.minPrice, minLowPrice: _data.minPrice,
quotationDesks: _data.awardProcesss quotationDesks: _data.awardProcesss
} }
fetchDataSource(_obj); fetchDataSource(_obj);
} }
}, [purchaseBiddingMessageSupplier]) }, [purchaseBiddingMessageSupplier])
const fetchDataSource = async (socketObj?: any) => { const fetchDataSource = async (socketObj?: any) => {
const params = { const params = {
id, id,
number, number,
current: '1', current: '1',
pageSize: '1' pageSize: '1'
}
await getPurchaseOnlineBiddingBiddingDetails({ ...params }).then(res => {
if (res.code !== 1000) {
history.goBack();
return;
}
const { data } = res;
let _flag = false;
if (socketObj) {
_flag = true;
data.ranking = socketObj.ranking;
data.minLowPrice = socketObj.minLowPrice;
}
data.onlineId = Number(onlineId);
let _data: any = { ...data };
_data?.offerLogs.forEach((item, index, arr) => {
const _arrLength = arr.length;
if (index != _arrLength - 1 && _arrLength > 2) {
_data.offerLogs[index].offerRatio = Number(((item.offerPrice - arr[index + 1].offerPrice) / arr[index + 1].offerPrice * 100).toFixed(2))
} }
await getPurchaseOnlineBiddingBiddingDetails({ ...params }).then(res => { })
if (res.code !== 1000) { setDataSource(_data);
history.goBack(); let _list = [];
return; let _offerList = [];
} let _minList = [];
const { data } = res; let _quotationDesks = data?.quotationDesks ? [...data.quotationDesks].reverse() : [];
let _flag = false; if (_flag) {
if (socketObj) { _quotationDesks = socketObj.quotationDesks.filter((item) => item.id == onlineId)
_flag = true; }
data.ranking = socketObj.ranking; _quotationDesks.forEach((item) => {
data.minLowPrice = socketObj.minLowPrice; _offerList.push({ type: 'offer', time: formatTimeString(item.offerTime || item.peportTime, 'HH:mm:ss'), value: priceFormat(item.price || item.sumPice, 0) });
} })
data.onlineId = Number(onlineId); _list.push({ title: intl.formatMessage({ id: 'detail.purchase.label4' }), type: 'offer', list: _offerList });
let _data : any = {...data}; if (data.isOpenPurchase) {
_data?.offerLogs.forEach((item,index,arr) => { _quotationDesks.forEach((item) => {
const _arrLength = arr.length; _minList.push({ type: 'min', time: formatTimeString(item.offerTime || item.peportTime, 'HH:mm:ss'), value: priceFormat(item.minPrice, 0) });
if (index != _arrLength - 1 && _arrLength > 2) {
_data.offerLogs[index].offerRatio = Number(((item.offerPrice - arr[index + 1].offerPrice) / arr[index + 1].offerPrice * 100).toFixed(2))
}
})
setDataSource(_data);
let _list = [];
let _offerList = [];
let _minList = [];
let _quotationDesks = data?.quotationDesks ? [...data.quotationDesks].reverse() : [];
if (_flag) {
_quotationDesks = socketObj.quotationDesks.filter((item) => item.id == onlineId)
}
_quotationDesks.forEach((item) => {
_offerList.push({ type: 'offer', time: formatTimeString(item.offerTime || item.peportTime, 'HH:mm:ss'), value: priceFormat(item.price || item.sumPice, 0) });
})
_list.push({ title: '报价金额', type: 'offer', list: _offerList });
if (data.isOpenPurchase) {
_quotationDesks.forEach((item) => {
_minList.push({ type: 'min', time: formatTimeString(item.offerTime || item.peportTime, 'HH:mm:ss'), value: priceFormat(item.minPrice, 0) });
})
_list.push({ title: '最低价', type: 'min', list: _minList });
}
setChartsList(_list)
}) })
} _list.push({ title: intl.formatMessage({ id: 'detail.purchase.minPrice1' }), type: 'min', list: _minList });
}
setChartsList(_list)
})
}
useEffect(() => { useEffect(() => {
fetchDataSource(); fetchDataSource();
}, []) }, [])
return ( return (
<div className={styles.warp}> <div className={styles.warp}>
<div className={styles.header}> <div className={styles.header}>
<ArrowLeftOutlined className={styles.goBack} onClick={() => history.goBack()} /> <ArrowLeftOutlined className={styles.goBack} onClick={() => history.goBack()} />
<div className={styles.title}>{dataSource?.details}<span>{dataSource?.memberName}</span><IMBtn func={() => toChatRoom(dataSource.memberId)} /></div> <div className={styles.title}>{dataSource?.details}<span>{dataSource?.memberName}</span><IMBtn func={() => toChatRoom(dataSource.memberId)} /></div>
</div> </div>
<div className={styles.layout}> <div className={styles.layout}>
<Row gutter={[8, 8]}> <Row gutter={[8, 8]}>
<Col span={6}> <Col span={6}>
<HistoryItem detail={dataSource} /> <HistoryItem detail={dataSource} />
</Col> </Col>
<Col span={12}> <Col span={12}>
<QuotationDeskLayout chartsList={chartsList} /> <QuotationDeskLayout chartsList={chartsList} />
</Col> </Col>
<Col span={6}> <Col span={6}>
<StatusBox detail={dataSource} hasBidBtn={true} /> <StatusBox detail={dataSource} hasBidBtn={true} />
</Col> </Col>
</Row> </Row>
<Row> <Row>
<BidDetailLayout detail={dataSource} btnType={2} /> <BidDetailLayout detail={dataSource} btnType={2} />
</Row> </Row>
</div> </div>
</div> </div>
) )
} }
export default observer(Detail); export default observer(Detail);
...@@ -6,35 +6,35 @@ import { priceFormat } from '@/utils/numberFomat'; ...@@ -6,35 +6,35 @@ import { priceFormat } from '@/utils/numberFomat';
import TrendTag from '../../../../components/detail/components/trendTag'; import TrendTag from '../../../../components/detail/components/trendTag';
import styles from './index.less'; import styles from './index.less';
import { getIntl } from 'umi';
const intl = getIntl();
interface OfferItemProps { interface OfferItemProps {
detail: any detail: any
} }
const OfferItem: React.FC<OfferItemProps> = (props: any) => { const OfferItem: React.FC<OfferItemProps> = (props: any) => {
const { detail } = props; const { detail } = props;
return ( return (
<div className={styles.offerItem}> <div className={styles.offerItem}>
<div className={styles.left}>{detail.isOpenRanking ? `第${detail.ranking}名` : '不公开'}</div> <div className={styles.left}>{detail.isOpenRanking ? `${intl.formatMessage({ id: 'detail.purchase.label4' })}${detail.ranking}${intl.formatMessage({ id: 'detail.purchase.label5' })}` : intl.formatMessage({ id: 'detail.purchase.label7' })}</div>
<div className={styles.right}> <div className={styles.right}>
<div className={styles.row}> <div className={styles.row}>
<div className={styles.rowPrice}> <div className={styles.rowPrice}>
<span>¥ {priceFormat(detail.offerPrice)}</span> <span>¥ {priceFormat(detail.offerPrice)}</span>
当前最低价:{detail.isOpenPurchase ? `¥${priceFormat(detail.minPrice)}` : '不公开'} {intl.formatMessage({ id: 'detail.purchase.nowMinPrice1' })}{detail.isOpenPurchase ? `¥${priceFormat(detail.minPrice)}` : '不公开'}
</div> </div>
{detail.offerCount} ${intl.formatMessage({ id: 'detail.purchase.label4' })}{detail.offerCount}${intl.formatMessage({ id: 'detail.purchase.label6' })}
</div> </div>
<div className={styles.row}> <div className={styles.row}>
<div className={styles.rowTime}> <div className={styles.rowTime}>
{formatTimeString(detail.offerTime, 'HH:mm:ss')} {formatTimeString(detail.offerTime, 'HH:mm:ss')}
</div> </div>
{detail.offerRatio ? <TrendTag ratio={detail.offerRatio} /> : ''} {detail.offerRatio ? <TrendTag ratio={detail.offerRatio} /> : ''}
</div>
</div>
</div> </div>
) </div>
</div>
)
} }
export default OfferItem export default OfferItem
\ No newline at end of file
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import { history } from 'umi'; import { getIntl, history } from 'umi';
import { Button, Badge, Typography, Space } from 'antd'; import { Button, Badge, Typography, Space } from 'antd';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons'; import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons';
...@@ -10,6 +10,8 @@ import StatusTag from '@/components/StatusTag'; ...@@ -10,6 +10,8 @@ import StatusTag from '@/components/StatusTag';
import Table from '../../components/table' import Table from '../../components/table'
const intl = getIntl();
import { import {
BID_EXTERNALSTATE_COLOR, BID_EXTERNALSTATE_COLOR,
BID_INTERNALSTATE_COLOR BID_INTERNALSTATE_COLOR
...@@ -21,13 +23,13 @@ const { Text } = Typography; ...@@ -21,13 +23,13 @@ const { Text } = Typography;
const ReadyBid = () => { const ReadyBid = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
title: '序号', title: intl.formatMessage({ id: 'table.purchase.id' }),
align: 'center', align: 'center',
dataIndex: 'id', dataIndex: 'id',
key: 'id', key: 'id',
render: (t, r, i) => ++i render: (t, r, i) => ++i
}, { }, {
title: '竞价单号/摘要', title: intl.formatMessage({ id: 'table.purchase.biddingNo' }),
key: 'biddingNo', key: 'biddingNo',
dataIndex: 'biddingNo', dataIndex: 'biddingNo',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
...@@ -38,7 +40,7 @@ const ReadyBid = () => { ...@@ -38,7 +40,7 @@ const ReadyBid = () => {
</Space> </Space>
) )
}, { }, {
title: '采购会员', title: intl.formatMessage({ id: 'table.purchase.createMemberName' }),
key: 'createMemberName', key: 'createMemberName',
dataIndex: 'createMemberName', dataIndex: 'createMemberName',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
...@@ -46,7 +48,7 @@ const ReadyBid = () => { ...@@ -46,7 +48,7 @@ const ReadyBid = () => {
url={`${ENTERPRISE_CENTER_URL}/shop/${record.createMemberId}_${record.createMemberRoleId}`}>{text}</EyePreview> url={`${ENTERPRISE_CENTER_URL}/shop/${record.createMemberId}_${record.createMemberRoleId}`}>{text}</EyePreview>
) )
}, { }, {
title: '竞价开始/结束时间', title: intl.formatMessage({ id: 'table.purchase.biddingStartTime' }),
key: 'biddingStartTime', key: 'biddingStartTime',
dataIndex: 'biddingStartTime', dataIndex: 'biddingStartTime',
render: (text: any, record: any) => <> render: (text: any, record: any) => <>
...@@ -55,7 +57,7 @@ const ReadyBid = () => { ...@@ -55,7 +57,7 @@ const ReadyBid = () => {
</>, </>,
width: 180 width: 180
}, { }, {
title: '竞价开始/结束时间', title: intl.formatMessage({ id: 'table.purchase.biddingStartTime' }),
key: 'startSignUp', key: 'startSignUp',
dataIndex: 'startSignUp', dataIndex: 'startSignUp',
render: (text: any, record: any) => <> render: (text: any, record: any) => <>
...@@ -64,7 +66,7 @@ const ReadyBid = () => { ...@@ -64,7 +66,7 @@ const ReadyBid = () => {
</>, </>,
width: 180 width: 180
}, { }, {
title: '外部状态', title: intl.formatMessage({ id: 'table.purchase.externalStatus' }),
key: 'externalState', key: 'externalState',
dataIndex: 'externalState', dataIndex: 'externalState',
render: (text: any, record: any) => <StatusTag type={BID_EXTERNALSTATE_COLOR(text)} title={record.externalStateName} /> render: (text: any, record: any) => <StatusTag type={BID_EXTERNALSTATE_COLOR(text)} title={record.externalStateName} />
...@@ -83,7 +85,7 @@ const ReadyBid = () => { ...@@ -83,7 +85,7 @@ const ReadyBid = () => {
onClick={() => { history.push(`/memberCenter/procurementAbility/onlineBid/readyBid/bid?id=${record.id}&number=${record.biddingNo}&onlineId=${record.onlineId}`) }} onClick={() => { history.push(`/memberCenter/procurementAbility/onlineBid/readyBid/bid?id=${record.id}&number=${record.biddingNo}&onlineId=${record.onlineId}`) }}
type='link' type='link'
> >
开始竞价 {intl.formatMessage({ id: 'detail.purchase.startStill' })}
</Button> </Button>
}]; }];
......
import React, { useRef } from 'react'; import React, { useRef } from 'react';
import { history } from 'umi'; import { getIntl, history } from 'umi';
import { Button, Badge, Typography, Space } from 'antd'; import { Button, Badge, Typography, Space } from 'antd';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons' import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons'
...@@ -9,91 +9,93 @@ import EyePreview from '@/components/EyePreview'; ...@@ -9,91 +9,93 @@ import EyePreview from '@/components/EyePreview';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import { getPurchaseOnlineBiddingStayExamineBiddingSignup } from '@/services/PurchaseV2Api'; import { getPurchaseOnlineBiddingStayExamineBiddingSignup } from '@/services/PurchaseV2Api';
const intl = getIntl();
import Table from '../../components/table' import Table from '../../components/table'
import { import {
BID_EXTERNALSTATE_COLOR, BID_EXTERNALSTATE_COLOR,
BID_INTERNALSTATE_COLOR BID_INTERNALSTATE_COLOR
} from '../../constants/purchaseBid'; } from '../../constants/purchaseBid';
const { Text } = Typography; const { Text } = Typography;
const ReadySignUp = () => { const ReadySignUp = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
title: '序号', title: intl.formatMessage({ id: 'table.purchase.id' }),
align: 'center', align: 'center',
dataIndex: 'id', dataIndex: 'id',
key: 'id', key: 'id',
render: (t, r, i) => ++i render: (t, r, i) => ++i
}, { }, {
title: '竞价单号/摘要', title: intl.formatMessage({ id: 'table.purchase.biddingNo' }),
key: 'biddingNo', key: 'biddingNo',
dataIndex: 'biddingNo', dataIndex: 'biddingNo',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space direction='vertical' style={{width: 300}}> <Space direction='vertical' style={{ width: 300 }}>
<EyePreview <EyePreview
url={`/memberCenter/procurementAbility/onlineBid/readySignUp/detail?id=${record.id}&number=${record.biddingNo}`}>{text}</EyePreview> url={`/memberCenter/procurementAbility/onlineBid/readySignUp/detail?id=${record.id}&number=${record.biddingNo}`}>{text}</EyePreview>
<Text type="secondary">{record.details}</Text> <Text type="secondary">{record.details}</Text>
</Space> </Space>
)
}, {
title: '采购会员',
key: 'createMemberName',
dataIndex: 'createMemberName',
render: (text: any, record: any) => (
<EyePreview url={`${ENTERPRISE_CENTER_URL}/shop/${record.createMemberId}_${record.createMemberRoleId}`}>{text}</EyePreview>
)
}, {
title: '竞价开始/结束时间',
key: 'biddingStartTime',
dataIndex: 'biddingStartTime',
render: (text: any, record: any) => <>
<div><PlayCircleOutlined />&nbsp;{formatTimeString(record.biddingStartTime)}</div>
<div><PoweroffOutlined />&nbsp;{formatTimeString(record.biddingEndTime)}</div>
</>,
width: 180
}, {
title: '报名开始/结束时间',
key: 'startSignUp',
dataIndex: 'startSignUp',
render: (text: any, record: any) => <>
<div><PlayCircleOutlined />&nbsp;{formatTimeString(record.startSignUp)}</div>
<div><PoweroffOutlined />&nbsp;{formatTimeString(record.endSignUp)}</div>
</>,
width: 180
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <StatusTag type={BID_EXTERNALSTATE_COLOR(text)} title={record.externalStateName} />
}, {
title: intl.formatMessage({ id: 'table.purchase.innerStatus' }),
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={BID_INTERNALSTATE_COLOR(text)} text={record.interiorStateName} />
}, {
title: intl.formatMessage({ id: 'table.purchase.operate' }),
key: 'operate',
dataIndex: 'operate',
align: 'center',
render: (text: any, record: any) => <Button
// disabled={moment().isBetween(moment(record.startSignUp).format('YYYY-MM-DD HH:mm:ss'), moment(record.endSignUp).format('YYYY-MM-DD HH:mm:ss'))}
onClick={() => { history.push(`/memberCenter/procurementAbility/onlineBid/readySignUp/signUp?id=${record.id}&number=${record.biddingNo}`) }}
type='link'
>
{record.button === 3 ? '报名' : '重新报名'}
</Button>
}];
return (
<Table
schemaType="ONLINEBIDREADYSIGN_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={getPurchaseOnlineBiddingStayExamineBiddingSignup}
reload={ref}
/>
) )
}, {
title: intl.formatMessage({ id: 'table.purchase.createMemberName' }),
key: 'createMemberName',
dataIndex: 'createMemberName',
render: (text: any, record: any) => (
<EyePreview url={`${ENTERPRISE_CENTER_URL}/shop/${record.createMemberId}_${record.createMemberRoleId}`}>{text}</EyePreview>
)
}, {
title: intl.formatMessage({ id: 'table.purchase.biddingStartTime' }),
key: 'biddingStartTime',
dataIndex: 'biddingStartTime',
render: (text: any, record: any) => <>
<div><PlayCircleOutlined />&nbsp;{formatTimeString(record.biddingStartTime)}</div>
<div><PoweroffOutlined />&nbsp;{formatTimeString(record.biddingEndTime)}</div>
</>,
width: 180
}, {
title: intl.formatMessage({ id: 'table.purchase.startSignUp' }),
key: 'startSignUp',
dataIndex: 'startSignUp',
render: (text: any, record: any) => <>
<div><PlayCircleOutlined />&nbsp;{formatTimeString(record.startSignUp)}</div>
<div><PoweroffOutlined />&nbsp;{formatTimeString(record.endSignUp)}</div>
</>,
width: 180
}, {
title: intl.formatMessage({ id: 'table.purchase.externalStatus' }),
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <StatusTag type={BID_EXTERNALSTATE_COLOR(text)} title={record.externalStateName} />
}, {
title: intl.formatMessage({ id: 'table.purchase.innerStatus' }),
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={BID_INTERNALSTATE_COLOR(text)} text={record.interiorStateName} />
}, {
title: intl.formatMessage({ id: 'table.purchase.operate' }),
key: 'operate',
dataIndex: 'operate',
align: 'center',
render: (text: any, record: any) => <Button
// disabled={moment().isBetween(moment(record.startSignUp).format('YYYY-MM-DD HH:mm:ss'), moment(record.endSignUp).format('YYYY-MM-DD HH:mm:ss'))}
onClick={() => { history.push(`/memberCenter/procurementAbility/onlineBid/readySignUp/signUp?id=${record.id}&number=${record.biddingNo}`) }}
type='link'
>
{record.button === 3 ? intl.formatMessage({ id: 'detail.purchase.label14' }) : intl.formatMessage({ id: 'detail.purchase.label15' })}
</Button>
}];
return (
<Table
schemaType="ONLINEBIDREADYSIGN_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={getPurchaseOnlineBiddingStayExamineBiddingSignup}
reload={ref}
/>
)
} }
export default ReadySignUp export default ReadySignUp
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { history } from 'umi'; import { getIntl, history } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Button, message } from 'antd'; import { Card, Button, message } from 'antd';
import { createFormActions } from '@formily/antd' import { createFormActions } from '@formily/antd'
...@@ -15,6 +15,7 @@ import ReutrnEle from '@/components/ReturnEle'; ...@@ -15,6 +15,7 @@ import ReutrnEle from '@/components/ReturnEle';
import { formatTimeString } from '@/utils' import { formatTimeString } from '@/utils'
import { getAuth } from '@/utils/auth' import { getAuth } from '@/utils/auth'
const intl = getIntl();
import { formSchema } from './schema' import { formSchema } from './schema'
...@@ -79,7 +80,7 @@ const SignUpForm = () => { ...@@ -79,7 +80,7 @@ const SignUpForm = () => {
const beforeUpload = file => { const beforeUpload = file => {
if (file.size / 1024 / 1024 > 20) { if (file.size / 1024 / 1024 > 20) {
message.warning('附件大小超过20M'); message.warning(intl.formatMessage({ id: 'detail.purchase.message21' }));
return Promise.reject(); return Promise.reject();
} }
setRefundDisabled(true); setRefundDisabled(true);
...@@ -124,9 +125,9 @@ const SignUpForm = () => { ...@@ -124,9 +125,9 @@ const SignUpForm = () => {
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />} backIcon={<ReutrnEle description={intl.formatMessage({ id: 'detail.purchase.back' })} />}
extra={ extra={
<Button disabled={refundDisabled} type="primary" onClick={() => addSchemaAction.submit()} loading={btnLoading} icon={<SaveOutlined />}> 保存</Button> <Button disabled={refundDisabled} type="primary" onClick={() => addSchemaAction.submit()} loading={btnLoading} icon={<SaveOutlined />}> {intl.formatMessage({ id: 'detail.purchase.save' })}</Button>
} }
> >
<Card> <Card>
......
...@@ -10,23 +10,26 @@ import { getPurchaseOnlineBiddingList, getPurchaseOnlineBiddingExternalStatus, g ...@@ -10,23 +10,26 @@ import { getPurchaseOnlineBiddingList, getPurchaseOnlineBiddingExternalStatus, g
import Table from '../../components/table' import Table from '../../components/table'
const intl = getIntl();
import { import {
BID_EXTERNALSTATE_COLOR, BID_EXTERNALSTATE_COLOR,
BID_INTERNALSTATE_COLOR BID_INTERNALSTATE_COLOR
} from '../../constants/purchaseBid'; } from '../../constants/purchaseBid';
import { getIntl } from 'umi';
const { Text } = Typography; const { Text } = Typography;
const Search = () => { const Search = () => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
title: '序号', title: intl.formatMessage({ id: 'table.purchase.id' }),
align: 'center', align: 'center',
dataIndex: 'id', dataIndex: 'id',
key: 'id', key: 'id',
render: (t, r, i) => ++i render: (t, r, i) => ++i
}, { }, {
title: '竞价单号/摘要', title: intl.formatMessage({ id: 'table.purchase.biddingNo' }),
key: 'biddingNo', key: 'biddingNo',
dataIndex: 'biddingNo', dataIndex: 'biddingNo',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
...@@ -37,12 +40,12 @@ const Search = () => { ...@@ -37,12 +40,12 @@ const Search = () => {
</Space> </Space>
) )
}, { }, {
title: '采购会员', title: intl.formatMessage({ id: 'table.purchase.createMemberName' }),
key: 'createMemberName', key: 'createMemberName',
dataIndex: 'createMemberName', dataIndex: 'createMemberName',
render: (text: any, record: any) => text render: (text: any, record: any) => text
}, { }, {
title: '竞价开始/结束时间', title: intl.formatMessage({ id: 'table.purchase.biddingStartTime' }),
key: 'biddingStartTime', key: 'biddingStartTime',
dataIndex: 'biddingStartTime', dataIndex: 'biddingStartTime',
render: (text: any, record: any) => <> render: (text: any, record: any) => <>
...@@ -51,7 +54,7 @@ const Search = () => { ...@@ -51,7 +54,7 @@ const Search = () => {
</>, </>,
width: 180 width: 180
}, { }, {
title: '报名开始/结束时间', title: intl.formatMessage({ id: 'table.purchase.startSignUp' }),
key: 'startSignUp', key: 'startSignUp',
dataIndex: 'startSignUp', dataIndex: 'startSignUp',
render: (text: any, record: any) => <> render: (text: any, record: any) => <>
...@@ -60,14 +63,14 @@ const Search = () => { ...@@ -60,14 +63,14 @@ const Search = () => {
</>, </>,
width: 180 width: 180
}, { }, {
title: '是否中标', title: intl.formatMessage({ id: 'table.purchase.isWin' }),
key: 'isPrize', key: 'isPrize',
dataIndex: 'isPrize', dataIndex: 'isPrize',
render: (text: any, record: any) => <> render: (text: any, record: any) => <>
{(text !== 1 && text !== 0) ? null : <StatusTag type={text ? 'success' : 'danger'} title={text ? '是' : '否'} />} {(text !== 1 && text !== 0) ? null : <StatusTag type={text ? 'success' : 'danger'} title={text ? intl.formatMessage({ id: 'table.purchase.okText' }) : intl.formatMessage({ id: 'table.purchase.cancelText' })} />}
</> </>
}, { }, {
title: '外部状态', title: intl.formatMessage({ id: 'table.purchase.externalStatus' }),
key: 'externalState', key: 'externalState',
dataIndex: 'externalState', dataIndex: 'externalState',
render: (text: any, record: any) => <StatusTag type={BID_EXTERNALSTATE_COLOR(text)} title={record.externalStateName} /> render: (text: any, record: any) => <StatusTag type={BID_EXTERNALSTATE_COLOR(text)} title={record.externalStateName} />
......
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