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