Commit 2193d6a7 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

feat: 待新增订单翻译

parent 44b07a7b
import menu from './zh-CN/menu'
import home from './zh-CN/home'
import order from './zh-CN/order'
export default {
'global.siteName': '瓴犀',
...menu,
...home,
...order,
}
export default {
// 采购订单列表
'purchaseOrder.showDataSourceName1' : '换货',
'purchaseOrder.showDataSourceName2' : '退货',
'purchaseOrder.showDataSourceName3' : '维修',
'purchaseOrder.error' : '请选择售后类型',
'purchaseOrder.operation1' : '取消订单',
'purchaseOrder.operation2' : '售后',
'purchaseOrder.operation3' : '评价',
'purchaseOrder.operation4' : '调整送货时间',
'purchaseOrder.addressTitle' : '送货地址',
'purchaseOrder.operation' : '操作',
'purchaseOrder.export' : '导出',
'purchaseOrder.modalTitle1' : '选择售后类型',
'purchaseOrder.modalTitle2' : '取消原因',
'purchaseOrder.modalTitle3' : '调整送货时间',
'purchaseOrder.schemaTitle1' : '当前id',
'purchaseOrder.schemaTitle2' : '取消原因',
'purchaseOrder.schemaTitle3' : '送货时间',
'purchaseOrder.schemaTitle4' : '时间段',
'purchaseOrder.schemaTitle5' : '调整原因',
'purchaseOrder.schemaPlaceholder1' : '在此输入你的原因, 最多50个汉字',
'purchaseOrder.message1' : '请输入原因',
'purchaseOrder.yes' : '是',
// 待新增订单--b2b srm 现货 请购
'purchaseOrder.readyAddOrder.error1' : '请先选择待新增的订单',
'purchaseOrder.readyAddOrder.button1' : '新建',
'purchaseOrder.readyAddOrder.button2' : '批量提交',
'purchaseOrder.readyAddOrder.button3' : '批量删除',
'purchaseOrder.readyAddOrder.modalTitle' : '选择下单模式',
'purchaseOrder.readyAddOrder.orderNo' : '请输入订单编号',
'purchaseOrder.readyAddOrder.digest' : '请输入订单摘要',
'purchaseOrder.readyAddOrder.memberName' : '请输入供应会员名称',
'purchaseOrder.readyAddOrder.orderType' : '请选择订单类型',
'purchaseOrder.readyAddOrder.startDate' : '开始时间',
'purchaseOrder.readyAddOrder.endDate' : '结束时间',
'purchaseOrder.readyAddOrder.submit' : '查询',
'purchaseOrder.readyAddOrder.useSelfTableOpeartion1' : '提交',
'purchaseOrder.readyAddOrder.useSelfTableOpeartion2' : '修改',
'purchaseOrder.readyAddOrder.useSelfTableOpeartion3' : '删除',
'purchaseOrder.readyAddOrder.payTypeLabel1' : '线上支付',
'purchaseOrder.readyAddOrder.payTypeLabel2' : '线下支付',
'purchaseOrder.readyAddOrder.payTypeLabel3' : '授信支付',
'purchaseOrder.readyAddOrder.payTypeLabel4' : '货到付款',
'purchaseOrder.readyAddOrder.memberColumns.memberId' : '会员ID',
'purchaseOrder.readyAddOrder.memberColumns.name' : '会员名称',
'purchaseOrder.readyAddOrder.memberColumns.memberTypeName' : '公司类型',
'purchaseOrder.readyAddOrder.memberColumns.roleName' : '公司角色',
'purchaseOrder.readyAddOrder.memberColumns.levelTag' : '公司等级',
'purchaseOrder.readyAddOrder.inquiryColumns.quotationNo' : '报价单号',
'purchaseOrder.readyAddOrder.inquiryColumns.requisitionFormNo' : '询价单号',
'purchaseOrder.readyAddOrder.inquiryColumns.quotationSummary' : '报价单摘要',
'purchaseOrder.readyAddOrder.inquiryColumns.demandMembers' : '询价会员',
'purchaseOrder.readyAddOrder.inquiryColumns.documentsTime' : '单据时间',
'purchaseOrder.readyAddOrder.paymentInformationColumns.payCount' : '支付次数',
'purchaseOrder.readyAddOrder.paymentInformationColumns.payNode' : '支付环节',
'purchaseOrder.readyAddOrder.paymentInformationColumns.externalState' : '外部状态',
'purchaseOrder.readyAddOrder.paymentInformationColumns.payRatio' : '支付比例',
'purchaseOrder.readyAddOrder.paymentInformationColumns.payPrice' : '支付金额',
'purchaseOrder.readyAddOrder.paymentInformationColumns.payWay' : '支付方式',
'purchaseOrder.readyAddOrder.paymentInformationColumns.channel' : '支付渠道',
'purchaseOrder.readyAddOrder.productInfoColumns.name' : '商品名称',
'purchaseOrder.readyAddOrder.productInfoColumns.customerCategoryName' : '品类',
'purchaseOrder.readyAddOrder.productInfoColumns.brandName' : '品牌',
'purchaseOrder.readyAddOrder.productInfoColumns.unitName' : '单位',
'purchaseOrder.readyAddOrder.productInfoColumns.unitPrice' : '单价',
'purchaseOrder.readyAddOrder.productInfoColumns.memberPrice' : '会员折扣',
'purchaseOrder.readyAddOrder.productInfoColumns.purchaseCount' : '采购数量',
'purchaseOrder.readyAddOrder.productInfoColumns.none' : '含税',
'purchaseOrder.readyAddOrder.productInfoColumns.price' : '金额',
'purchaseOrder.readyAddOrder.productInfoColumns.logistics' : '配送方式',
}
......@@ -49,7 +49,7 @@ const AnyQuestion: React.FC<Iprops> = () => {
target={"__blank"}
onClick={openIMServer}
>
我要提问
{intl.formatMessage({ id: 'home.anyQuestion.ask' })}
</a>
</div>
}
......
......@@ -548,7 +548,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const handleSubmitModifyPrice = () => {
modifyPriceActions.submit().then(async ({values}: any) => {
values.orderId = data.orderId
console.log(values)
values.prices = [{...values}]
const result = await runPrice(values)
if (result.code === 1000) {
modifyPriceActions.reset()
......
......@@ -3,7 +3,7 @@ import { Card, Button, Modal, Row, Col, message } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { baseOrderListColumns } from './constant'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import { tableListSchema } from '../_public/order/constant'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
......@@ -67,6 +67,7 @@ const destroyActions = createFormActions()
const adjustActions = createFormActions();
const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const intl = useIntl()
const [saleVisible, setSaleVisible] = useState<any>(false)
const [checkedId, setCheckedId] = useState<any>()
const [recordId, setRecordId] = useState<any>()
......@@ -76,9 +77,9 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const adjustRef = useRef<any>({})
const { run, loading } = useHttpRequest(postOrderBuyerCancel)
const [showDataSource, setShowDataSource] = useState([
{ id: 1, name: "换货"},
{ id: 2, name: "退货"},
{ id: 3, name: "维修"},
{ id: 1, name: intl.formatMessage({ id: 'purchaseOrder.showDataSourceName1' })},
{ id: 2, name: intl.formatMessage({ id: 'purchaseOrder.showDataSourceName2' })},
{ id: 3, name: intl.formatMessage({ id: 'purchaseOrder.showDataSourceName3' })},
])
const fetchParams = useRef<any>({})
const { token } = (getAuth() || {})
......@@ -95,13 +96,13 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
setOrderType(orderType)
if(orderType === ORDER_TYPE_POINTS) {
setShowDataSource(() => [
{ id: 1, name: "换货"},
{ id: 1, name: intl.formatMessage({ id: 'purchaseOrder.showDataSourceName1' }) },
])
} else {
setShowDataSource(() => [
{ id: 1, name: "换货"},
{ id: 2, name: "退货"},
{ id: 3, name: "维修"}
{ id: 1, name: intl.formatMessage({ id: 'purchaseOrder.showDataSourceName1' }) },
{ id: 2, name: intl.formatMessage({ id: 'purchaseOrder.showDataSourceName2' }) },
{ id: 3, name: intl.formatMessage({ id: 'purchaseOrder.showDataSourceName3' }) }
])
}
}
......@@ -120,7 +121,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
break;
}
} else {
message.error("请选择售后类型")
message.error(intl.formatMessage({ id: 'purchaseOrder.error' }))
}
}
......@@ -151,17 +152,17 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const buttonGroup = {
'取消订单': record.showCancel,
'售后': record.showAfterSales,
'评价': record.showComment,
'调整送货时间': record.showModifyDeliverTime
[intl.formatMessage({id: 'purchaseOrder.operation1'})]: record.showCancel,
[intl.formatMessage({id: 'purchaseOrder.operation2'})]: record.showAfterSales,
[intl.formatMessage({id: 'purchaseOrder.operation3'})]: record.showComment,
[intl.formatMessage({id: 'purchaseOrder.operation4'})]: record.showModifyDeliverTime
}
const operationHandler = {
'取消订单': () => handleCancel(record.orderId),
'售后': () => handleSaleAfter(record),
'评价': () => handleEvaluate(record.orderId),
'调整送货时间': () => handleAdjust(record)
[intl.formatMessage({id: 'purchaseOrder.operation1'})]: () => handleCancel(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.operation2'})]: () => handleSaleAfter(record),
[intl.formatMessage({id: 'purchaseOrder.operation3'})]: () => handleEvaluate(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.operation4'})]: () => handleAdjust(record)
}
return (
......@@ -176,7 +177,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const alreadyColumns = baseOrderListColumns()
if(alreadyColumns) {
alreadyColumns.splice(6, 0, {
title: '送货地址',
title: intl.formatMessage({id:'purchaseOrder.addressTitle'}),
dataIndex: 'deliverAddress',
key: 'deliverAddress',
width: 164,
......@@ -184,7 +185,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
});
return alreadyColumns.concat([
{
title: '操作',
title: intl.formatMessage({id:'purchaseOrder.operation'}),
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
......@@ -271,7 +272,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
adjustActions.reset()
}
const controllerBtns = <Button style={{width: 140}} onClick={handleExport} type='default'>导出</Button>
const controllerBtns = <Button style={{width: 140}} onClick={handleExport} type='default'>{intl.formatMessage({ id: 'purchaseOrder.export' })}</Button>
return <PageHeaderWrapper>
<Card>
......@@ -307,7 +308,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
/>
</Card>
<Modal
title="选择售后类型"
title={intl.formatMessage({ id: 'purchaseOrder.modalTitle1' })}
visible={saleVisible}
onOk={handleOk}
onCancel={()=>setSaleVisible(false)}
......@@ -332,7 +333,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
</div>
</Modal>
<ModalForm
modalTitle='取消原因'
title={intl.formatMessage({ id: 'purchaseOrder.modalTitle2' })}
currentRef={destoryRef}
confirm={handleSubmit}
actions={destroyActions}
......@@ -348,20 +349,20 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
properties: {
orderId: {
type: 'number',
title: '当前id',
title: intl.formatMessage({id: 'purchaseOrder.schemaTitle1'}),
visible: false,
},
reason: {
type: 'textarea',
"x-component-props": {
rows: 4,
placeholder: '在此输入你的原因, 最多50个汉字'
placeholder: intl.formatMessage({id: 'purchaseOrder.schemaPlaceholder1'})
},
title: '取消原因',
title: intl.formatMessage({id: 'purchaseOrder.schemaTitle2'}),
"x-rules": [
{
required: true,
message: '请输入取消原因'
message: intl.formatMessage({id: 'purchaseOrder.message1'})
},
{
limitByte: true,
......@@ -377,7 +378,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
/>
{/* 调整送货时间 */}
<ModalForm
modalTitle='调整送货时间'
title={intl.formatMessage({ id: 'purchaseOrder.modalTitle3' })}
currentRef={adjustRef}
confirm={handleSubmitAdjust}
cancel={resetAdjustSelect}
......@@ -395,13 +396,13 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
properties: {
orderId: {
type: 'number',
title: '当前id',
title: intl.formatMessage({ id: 'purchaseOrder.schemaTitle1' }),
visible: false,
},
deliverDate: {
type: 'string',
"x-component": 'date',
title: '送货时间',
title: intl.formatMessage({ id: 'purchaseOrder.schemaTitle3' }),
required: true,
"x-component-props": {
// disabledDate: current => {
......@@ -413,7 +414,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
}
},
timeLine: {
title: '时间段',
title: intl.formatMessage({ id: 'purchaseOrder.schemaTitle4'}),
type: 'radio',
enum: [],
"x-component-props": {
......@@ -426,13 +427,13 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
type: 'textarea',
"x-component-props": {
rows: 4,
placeholder: '在此输入你的原因, 最多50个汉字'
placeholder: intl.formatMessage({id: 'purchaseOrder.schemaPlaceholder1'})
},
title: '调整原因',
title: intl.formatMessage({id: 'purchaseOrder.schemaTitle5'}),
"x-rules": [
{
required: true,
message: '请输入调整原因'
message: intl.formatMessage({id: 'purchaseOrder.message1'})
},
{
limitByte: true,
......
import React from 'react'
import { formatTimeString } from '@/utils'
import { Row } from 'antd'
import { useIntl } from 'umi'
const intl = useIntl()
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......@@ -99,50 +102,50 @@ export const orderCombination = {
// 支付方式
export const payTypeLabel = [
{
label: '线上支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel1'}),
value: 1
},
{
label: '线下支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel2'}),
value: 2
},
{
label: '授信支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel3'}),
value: 3
},
{
label: '货到付款',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel4'}),
value: 4
},
]
export const memberColumns: any[] = [
{
title: '会员ID',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.memberId'}),
dataIndex: 'memberId',
align: 'center',
key: 'memberId',
},
{
title: '会员名称',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '公司类型',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.memberTypeName'}),
dataIndex: 'memberTypeName',
align: 'center',
key: 'memberTypeName',
},
{
title: '公司角色',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.roleName'}),
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '公司等级',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.levelTag'}),
dataIndex: 'levelTag',
align: 'center',
key: 'levelTag',
......@@ -151,31 +154,31 @@ export const memberColumns: any[] = [
export const inquiryColumns: any[] = [
{
title: '报价单号',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.quotationNo'}),
dataIndex: 'quotationNo',
align: 'center',
key: 'quotationNo',
},
{
title: '询价单号',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.requisitionFormNo'}),
dataIndex: 'requisitionFormNo',
align: 'center',
key: 'requisitionFormNo',
},
{
title: '报价单摘要',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.quotationSummary'}),
dataIndex: 'quotationSummary',
align: 'center',
key: 'quotationSummary',
},
{
title: '询价会员',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.demandMembers'}),
dataIndex: 'demandMembers',
align: 'center',
key: 'demandMembers',
},
{
title: '单据时间',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.documentsTime'}),
dataIndex: 'documentsTime',
align: 'center',
key: 'documentsTime',
......@@ -185,25 +188,25 @@ export const inquiryColumns: any[] = [
export const paymentInformationColumns: any[] = [
{
title: '支付次数',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payCount'}),
dataIndex: 'payCount',
align: 'center',
key: 'payCount'
},
{
title: '支付环节',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payNode'}),
dataIndex: 'payNode',
align: 'center',
key: 'payNode'
},
{
title: '外部状态',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.externalState'}),
dataIndex: 'externalState',
align: 'center',
key: 'externalState'
},
{
title: '支付比例',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payRatio'}),
dataIndex: 'payRatio',
key: 'payRatio',
editable: true,
......@@ -215,14 +218,14 @@ export const paymentInformationColumns: any[] = [
width: 200
},
{
title: '支付金额',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payPrice'}),
dataIndex: 'payPrice',
align: 'center',
key: 'payPrice',
render: (t) => `¥${t}`
},
{
title: '支付方式',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payWay'}),
dataIndex: 'payWay',
key: 'payWay',
formItem: 'select',
......@@ -234,7 +237,7 @@ export const paymentInformationColumns: any[] = [
width: 200
},
{
title: '支付渠道',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.channel'}),
dataIndex: 'channel',
key: 'channel',
formItem: 'select',
......@@ -253,45 +256,45 @@ export const productInfoColumns: any[] = [
key: 'id',
},
{
title: '商品名称',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '品类',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.customerCategoryName'}),
dataIndex: 'customerCategoryName',
align: 'center',
key: 'customerCategoryName',
},
{
title: '品牌',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.brandName'}),
dataIndex: 'brandName',
align: 'center',
key: 'brandName',
},
{
title: '单位',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.unitName'}),
dataIndex: 'unitName',
align: 'center',
key: 'unitName',
},
{
title: '单价',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.unitPrice'}),
dataIndex: 'unitPrice',
align: 'left',
key: 'unitPrice',
render: text => <PriceComp priceSection={text}/>
},
{
title: '会员折扣',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.memberPrice'}),
dataIndex: 'memberPrice',
align: 'center',
key: 'memberPrice',
render: (text, record) => record.isMemberPrice ? text : null
},
{
title: '采购数量',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.purchaseCount'}),
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
......@@ -300,14 +303,14 @@ export const productInfoColumns: any[] = [
width: 140
},
{
title: '含税',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.none'}),
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
render: () => intl.formatMessage({id: 'purchaseOrder.yes'})
},
{
title: '金额',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.price'}),
dataIndex: 'price',
align: 'center',
key: 'price',
......@@ -315,55 +318,16 @@ export const productInfoColumns: any[] = [
},
// 接口调用
{
title: '配送方式',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.logistics'}),
dataIndex: 'logistics',
align: 'center',
key: 'logistics',
render: text => text.render || ''
},
{
title: '操作',
title: intl.formatMessage({id: 'purchaseOrder.operation'}),
dataIndex: 'ctl',
align: 'center',
key: 'ctl',
},
]
export const mergeOrderColumns: any[] = [
{
title: '订单号',
dataIndex: 'orderNo',
align: 'center',
key: 'orderNo',
},
{
title: '订单摘要',
dataIndex: 'orderThe',
align: 'center',
key: 'orderThe',
},
{
title: '采购商名称',
dataIndex: 'supplyMembersName',
align: 'center',
key: 'supplyMembersName',
},
{
title: '下单时间',
dataIndex: 'createTime',
align: 'center',
key: 'createTime',
},
{
title: '活动时间',
dataIndex: 'none',
align: 'center',
key: 'none',
},
{
title: '活动名称',
dataIndex: 'none',
align: 'center',
key: 'none',
}
]
import React from 'react'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import { Card, Button, Space, Menu, message } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -29,6 +29,7 @@ const fetchTableData = async (params) => {
}
const ReadyAddB2bOrder:React.FC<ReadyAddB2bOrderProps> = () => {
const intl = useIntl()
const { run: deleteRun } = useHttpRequest(postOrderBuyerCreateDeleteBatch)
const { loading: submitLoading, run: submitRun } = useHttpRequest(postOrderBuyerCreateSubmitBatch)
const { columns, ref, rowSelection, rowSelectionCtl } = useSelfTable()
......@@ -44,7 +45,7 @@ const ReadyAddB2bOrder:React.FC<ReadyAddB2bOrderProps> = () => {
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('请先选择待新增的订单')
message.error(intl.formatMessage({id: 'purchaseOrder.readyAddOrder.error1'}))
}
break;
}
......@@ -60,7 +61,7 @@ const ReadyAddB2bOrder:React.FC<ReadyAddB2bOrderProps> = () => {
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('请先选择待新增的订单')
message.error(intl.formatMessage({id: 'purchaseOrder.readyAddOrder.error1'}))
}
}
......@@ -109,13 +110,15 @@ const ReadyAddB2bOrder:React.FC<ReadyAddB2bOrderProps> = () => {
type='primary'
onClick={clickAdd}
>
新建
{intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button1'})}
</Button>
<Button onClick={handleBitchPush} loading={submitLoading}>
{intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button2'})}
</Button>
<Button onClick={handleBitchPush} loading={submitLoading}>批量提交</Button>
<DropDeleteDown>
<Menu onClick={(e) => handleMenuClick(e)}>
<Menu.Item key="1" icon={<DeleteOutlined />}>
批量删除
{intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button3'})}
</Menu.Item>
</Menu>
</DropDeleteDown>
......
import React, { useRef } from 'react'
import { baseOrderListColumns } from '../../constant'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import TableOperation from '@/components/TableOperation'
import { postOrderBuyerCreateDelete, postOrderBuyerCreateSubmit } from '@/services/OrderNewV2Api'
// 业务hooks, 待新增询价报价订单
export const useSelfTable = () => {
const intl = useIntl()
const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'orderId'})
......@@ -26,12 +27,16 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const buttonGroup = { '提交': true, '修改': record.showUpdate, '删除': true }
const buttonGroup = {
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion1'})]: true,
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion2'})]: record.showUpdate,
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion3'})]: true
}
const operationHandler = {
'提交': () => handleSubmit(record.orderId),
'修改': () => handleEdit(record),
'删除': () => handleDelete(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion1'})]: () => handleSubmit(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion2'})]: () => handleEdit(record),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion3'})]: () => handleDelete(record.orderId),
}
return (
......@@ -47,7 +52,7 @@ export const useSelfTable = () => {
if(alreadyColumns) {
return alreadyColumns.concat([
{
title: '操作',
title: intl.formatMessage({id: 'purchaseOrder.operation'}),
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
......
// import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useIntl } from 'umi';
// import { getPurchaseOrderReadyAddPageSelectOption } from '@/pages/transaction/effect';
export const tableListSchema: any = () => {
const intl = useIntl()
// const res = getPurchaseOrderReadyAddPageSelectOption()
// if(res) {
......@@ -17,7 +19,7 @@ export const tableListSchema: any = () => {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.orderNo'}),
align: 'flex-end',
},
},
......@@ -34,36 +36,26 @@ export const tableListSchema: any = () => {
"digest": {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.digest'}),
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberName'}),
}
},
// "orderType": {
// type: 'string',
// "x-component-props": {
// placeholder: '请选择订单类型'
// },
// enum: OrderType.map(item => ({
// label: item['text'],
// value: item['id'],
// }))
// },
"[startDate,endDate]": {
type: 'daterange',
// "x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
placeholder: [intl.formatMessage({id: 'purchaseOrder.readyAddOrder.startDate'}), intl.formatMessage({id: 'purchaseOrder.readyAddOrder.endDate'})],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
children: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.submit'}),
},
},
},
......
import React from 'react'
import { formatTimeString } from '@/utils'
import { Row } from 'antd'
import { useIntl } from 'umi'
const intl = useIntl()
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......@@ -99,50 +102,50 @@ export const orderCombination = {
// 支付方式
export const payTypeLabel = [
{
label: '线上支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel1'}),
value: 1
},
{
label: '线下支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel2'}),
value: 2
},
{
label: '授信支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel3'}),
value: 3
},
{
label: '货到付款',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel4'}),
value: 4
},
]
export const memberColumns: any[] = [
{
title: '会员ID',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.memberId'}),
dataIndex: 'memberId',
align: 'center',
key: 'memberId',
},
{
title: '会员名称',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '公司类型',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.memberTypeName'}),
dataIndex: 'memberTypeName',
align: 'center',
key: 'memberTypeName',
},
{
title: '公司角色',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.roleName'}),
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '公司等级',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.levelTag'}),
dataIndex: 'levelTag',
align: 'center',
key: 'levelTag',
......@@ -151,31 +154,31 @@ export const memberColumns: any[] = [
export const inquiryColumns: any[] = [
{
title: '报价单号',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.quotationNo'}),
dataIndex: 'quotationNo',
align: 'center',
key: 'quotationNo',
},
{
title: '询价单号',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.requisitionFormNo'}),
dataIndex: 'requisitionFormNo',
align: 'center',
key: 'requisitionFormNo',
},
{
title: '报价单摘要',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.quotationSummary'}),
dataIndex: 'quotationSummary',
align: 'center',
key: 'quotationSummary',
},
{
title: '询价会员',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.demandMembers'}),
dataIndex: 'demandMembers',
align: 'center',
key: 'demandMembers',
},
{
title: '单据时间',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.documentsTime'}),
dataIndex: 'documentsTime',
align: 'center',
key: 'documentsTime',
......@@ -185,25 +188,25 @@ export const inquiryColumns: any[] = [
export const paymentInformationColumns: any[] = [
{
title: '支付次数',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payCount'}),
dataIndex: 'payCount',
align: 'center',
key: 'payCount'
},
{
title: '支付环节',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payNode'}),
dataIndex: 'payNode',
align: 'center',
key: 'payNode'
},
{
title: '外部状态',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.externalState'}),
dataIndex: 'externalState',
align: 'center',
key: 'externalState'
},
{
title: '支付比例',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payRatio'}),
dataIndex: 'payRatio',
key: 'payRatio',
editable: true,
......@@ -215,14 +218,14 @@ export const paymentInformationColumns: any[] = [
width: 200
},
{
title: '支付金额',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payPrice'}),
dataIndex: 'payPrice',
align: 'center',
key: 'payPrice',
render: (t) => `¥${t}`
},
{
title: '支付方式',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payWay'}),
dataIndex: 'payWay',
key: 'payWay',
formItem: 'select',
......@@ -234,7 +237,7 @@ export const paymentInformationColumns: any[] = [
width: 200
},
{
title: '支付渠道',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.channel'}),
dataIndex: 'channel',
key: 'channel',
formItem: 'select',
......@@ -253,45 +256,45 @@ export const productInfoColumns: any[] = [
key: 'id',
},
{
title: '商品名称',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '品类',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.customerCategoryName'}),
dataIndex: 'customerCategoryName',
align: 'center',
key: 'customerCategoryName',
},
{
title: '品牌',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.brandName'}),
dataIndex: 'brandName',
align: 'center',
key: 'brandName',
},
{
title: '单位',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.unitName'}),
dataIndex: 'unitName',
align: 'center',
key: 'unitName',
},
{
title: '单价',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.unitPrice'}),
dataIndex: 'unitPrice',
align: 'left',
key: 'unitPrice',
render: text => <PriceComp priceSection={text}/>
},
{
title: '会员折扣',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.memberPrice'}),
dataIndex: 'memberPrice',
align: 'center',
key: 'memberPrice',
render: (text, record) => record.isMemberPrice ? text : null
},
{
title: '采购数量',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.purchaseCount'}),
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
......@@ -300,14 +303,14 @@ export const productInfoColumns: any[] = [
width: 140
},
{
title: '含税',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.none'}),
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
render: () => intl.formatMessage({id: 'purchaseOrder.yes'})
},
{
title: '金额',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.price'}),
dataIndex: 'price',
align: 'center',
key: 'price',
......@@ -315,55 +318,16 @@ export const productInfoColumns: any[] = [
},
// 接口调用
{
title: '配送方式',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.logistics'}),
dataIndex: 'logistics',
align: 'center',
key: 'logistics',
render: text => text.render || ''
},
{
title: '操作',
title: intl.formatMessage({id: 'purchaseOrder.operation'}),
dataIndex: 'ctl',
align: 'center',
key: 'ctl',
},
]
export const mergeOrderColumns: any[] = [
{
title: '订单号',
dataIndex: 'orderNo',
align: 'center',
key: 'orderNo',
},
{
title: '订单摘要',
dataIndex: 'orderThe',
align: 'center',
key: 'orderThe',
},
{
title: '采购商名称',
dataIndex: 'supplyMembersName',
align: 'center',
key: 'supplyMembersName',
},
{
title: '下单时间',
dataIndex: 'createTime',
align: 'center',
key: 'createTime',
},
{
title: '活动时间',
dataIndex: 'none',
align: 'center',
key: 'none',
},
{
title: '活动名称',
dataIndex: 'none',
align: 'center',
key: 'none',
}
]
import React from 'react'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import { Card, Button, Space, Menu, message } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -27,6 +27,7 @@ const fetchTableData = async (params) => {
}
const ReadyAddCashOrder:React.FC<ReadyAddCashOrderProps> = () => {
const intl = useIntl()
const { run: deleteRun } = useHttpRequest(postOrderBuyerCreateDeleteBatch)
const { loading: submitLoading, run: submitRun } = useHttpRequest(postOrderBuyerCreateSubmitBatch)
const { columns, ref, rowSelection, rowSelectionCtl } = useSelfTable()
......@@ -42,7 +43,7 @@ const ReadyAddCashOrder:React.FC<ReadyAddCashOrderProps> = () => {
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('请先选择待新增的订单')
message.error(intl.formatMessage({id: 'purchaseOrder.readyAddOrder.error1'}))
}
break;
}
......@@ -58,7 +59,7 @@ const ReadyAddCashOrder:React.FC<ReadyAddCashOrderProps> = () => {
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('请先选择待新增的订单')
message.error(intl.formatMessage({id: 'purchaseOrder.readyAddOrder.error1'}))
}
}
......@@ -107,13 +108,15 @@ const ReadyAddCashOrder:React.FC<ReadyAddCashOrderProps> = () => {
type='primary'
onClick={clickAdd}
>
新建
{intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button1'})}
</Button>
<Button onClick={handleBitchPush} loading={submitLoading}>
{intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button2'})}
</Button>
<Button onClick={handleBitchPush} loading={submitLoading}>批量提交</Button>
<DropDeleteDown>
<Menu onClick={(e) => handleMenuClick(e)}>
<Menu.Item key="1" icon={<DeleteOutlined />}>
批量删除
{intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button3'})}
</Menu.Item>
</Menu>
</DropDeleteDown>
......
import React, { useRef } from 'react'
import { baseOrderListColumns } from '../../constant'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import TableOperation from '@/components/TableOperation'
import { postOrderBuyerCreateDelete, postOrderBuyerCreateSubmit } from '@/services/OrderNewV2Api'
// 业务hooks, 待新增订单
export const useSelfTable = () => {
const ref = useRef<any>({})
const intl = useIntl()
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'orderId'})
const handleSubmit = async (id) => {
......@@ -26,12 +27,16 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const buttonGroup = { '提交': true, '修改': record.showUpdate, '删除': true }
const buttonGroup = {
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion1'})]: true,
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion2'})]: record.showUpdate,
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion3'})]: true
}
const operationHandler = {
'提交': () => handleSubmit(record.orderId),
'修改': () => handleEdit(record),
'删除': () => handleDelete(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion1'})]: () => handleSubmit(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion2'})]: () => handleEdit(record),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion3'})]: () => handleDelete(record.orderId),
}
return (
......@@ -47,7 +52,7 @@ export const useSelfTable = () => {
if(alreadyColumns) {
return alreadyColumns.concat([
{
title: '操作',
title: intl.formatMessage({id: 'purchaseOrder.operation'}),
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
......
// import { ISchema } from '@formily/antd';
import { useIntl } from '@/.umi/plugin-locale/localeExports';
import { FORM_FILTER_PATH } from '@/formSchema/const';
// import { getPurchaseOrderReadyAddPageSelectOption } from '@/pages/transaction/effect';
export const tableListSchema: any = () => {
const intl = useIntl()
// const res = getPurchaseOrderReadyAddPageSelectOption()
// if(res) {
// const {
......@@ -17,7 +18,7 @@ export const tableListSchema: any = () => {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.orderNo'}),
align: 'flex-end',
},
},
......@@ -34,36 +35,26 @@ export const tableListSchema: any = () => {
"digest": {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.digest'}),
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberName'}),
}
},
// "orderType": {
// type: 'string',
// "x-component-props": {
// placeholder: '请选择订单类型'
// },
// enum: OrderType.map(item => ({
// label: item['text'],
// value: item['id'],
// }))
// },
"[startDate,endDate]": {
type: 'daterange',
// "x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
placeholder: [intl.formatMessage({id: 'purchaseOrder.readyAddOrder.startDate'}), intl.formatMessage({id: 'purchaseOrder.readyAddOrder.endDate'})],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
children: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.submit'}),
},
},
},
......
import React from 'react'
import { formatTimeString } from '@/utils'
import { Row } from 'antd'
import { useIntl } from 'umi'
const intl = useIntl()
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......@@ -99,50 +102,50 @@ export const orderCombination = {
// 支付方式
export const payTypeLabel = [
{
label: '线上支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel1'}),
value: 1
},
{
label: '线下支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel2'}),
value: 2
},
{
label: '授信支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel3'}),
value: 3
},
{
label: '货到付款',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel4'}),
value: 4
},
]
export const memberColumns: any[] = [
{
title: '会员ID',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.memberId'}),
dataIndex: 'memberId',
align: 'center',
key: 'memberId',
},
{
title: '会员名称',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '公司类型',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.memberTypeName'}),
dataIndex: 'memberTypeName',
align: 'center',
key: 'memberTypeName',
},
{
title: '公司角色',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.roleName'}),
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '公司等级',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.levelTag'}),
dataIndex: 'levelTag',
align: 'center',
key: 'levelTag',
......@@ -151,31 +154,31 @@ export const memberColumns: any[] = [
export const inquiryColumns: any[] = [
{
title: '报价单号',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.quotationNo'}),
dataIndex: 'quotationNo',
align: 'center',
key: 'quotationNo',
},
{
title: '询价单号',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.requisitionFormNo'}),
dataIndex: 'requisitionFormNo',
align: 'center',
key: 'requisitionFormNo',
},
{
title: '报价单摘要',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.quotationSummary'}),
dataIndex: 'quotationSummary',
align: 'center',
key: 'quotationSummary',
},
{
title: '询价会员',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.demandMembers'}),
dataIndex: 'demandMembers',
align: 'center',
key: 'demandMembers',
},
{
title: '单据时间',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.documentsTime'}),
dataIndex: 'documentsTime',
align: 'center',
key: 'documentsTime',
......@@ -185,25 +188,25 @@ export const inquiryColumns: any[] = [
export const paymentInformationColumns: any[] = [
{
title: '支付次数',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payCount'}),
dataIndex: 'payCount',
align: 'center',
key: 'payCount'
},
{
title: '支付环节',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payNode'}),
dataIndex: 'payNode',
align: 'center',
key: 'payNode'
},
{
title: '外部状态',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.externalState'}),
dataIndex: 'externalState',
align: 'center',
key: 'externalState'
},
{
title: '支付比例',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payRatio'}),
dataIndex: 'payRatio',
key: 'payRatio',
editable: true,
......@@ -215,14 +218,14 @@ export const paymentInformationColumns: any[] = [
width: 200
},
{
title: '支付金额',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payPrice'}),
dataIndex: 'payPrice',
align: 'center',
key: 'payPrice',
render: (t) => `¥${t}`
},
{
title: '支付方式',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payWay'}),
dataIndex: 'payWay',
key: 'payWay',
formItem: 'select',
......@@ -234,7 +237,7 @@ export const paymentInformationColumns: any[] = [
width: 200
},
{
title: '支付渠道',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.channel'}),
dataIndex: 'channel',
key: 'channel',
formItem: 'select',
......@@ -253,45 +256,45 @@ export const productInfoColumns: any[] = [
key: 'id',
},
{
title: '商品名称',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '品类',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.customerCategoryName'}),
dataIndex: 'customerCategoryName',
align: 'center',
key: 'customerCategoryName',
},
{
title: '品牌',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.brandName'}),
dataIndex: 'brandName',
align: 'center',
key: 'brandName',
},
{
title: '单位',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.unitName'}),
dataIndex: 'unitName',
align: 'center',
key: 'unitName',
},
{
title: '单价',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.unitPrice'}),
dataIndex: 'unitPrice',
align: 'left',
key: 'unitPrice',
render: text => <PriceComp priceSection={text}/>
},
{
title: '会员折扣',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.memberPrice'}),
dataIndex: 'memberPrice',
align: 'center',
key: 'memberPrice',
render: (text, record) => record.isMemberPrice ? text : null
},
{
title: '采购数量',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.purchaseCount'}),
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
......@@ -300,14 +303,14 @@ export const productInfoColumns: any[] = [
width: 140
},
{
title: '含税',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.none'}),
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
render: () => intl.formatMessage({id: 'purchaseOrder.yes'})
},
{
title: '金额',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.price'}),
dataIndex: 'price',
align: 'center',
key: 'price',
......@@ -315,55 +318,16 @@ export const productInfoColumns: any[] = [
},
// 接口调用
{
title: '配送方式',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.logistics'}),
dataIndex: 'logistics',
align: 'center',
key: 'logistics',
render: text => text.render || ''
},
{
title: '操作',
title: intl.formatMessage({id: 'purchaseOrder.operation'}),
dataIndex: 'ctl',
align: 'center',
key: 'ctl',
},
]
export const mergeOrderColumns: any[] = [
{
title: '订单号',
dataIndex: 'orderNo',
align: 'center',
key: 'orderNo',
},
{
title: '订单摘要',
dataIndex: 'orderThe',
align: 'center',
key: 'orderThe',
},
{
title: '采购商名称',
dataIndex: 'supplyMembersName',
align: 'center',
key: 'supplyMembersName',
},
{
title: '下单时间',
dataIndex: 'createTime',
align: 'center',
key: 'createTime',
},
{
title: '活动时间',
dataIndex: 'none',
align: 'center',
key: 'none',
},
{
title: '活动名称',
dataIndex: 'none',
align: 'center',
key: 'none',
}
]
import React, { useRef } from 'react'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import { Card, Button, Space, Menu, message } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -37,6 +37,7 @@ const fetchOrderMode = async () => {
}
const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
const intl = useIntl()
const { run: deleteRun } = useHttpRequest(postOrderBuyerCreateDeleteBatch)
const { loading: submitLoading, run: submitRun } = useHttpRequest(postOrderBuyerCreateSubmitBatch)
const currentRef = useRef<any>({})
......@@ -53,7 +54,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('请先选择待新增的订单')
message.error(intl.formatMessage({id: 'purchaseOrder.readyAddOrder.error1'}))
}
break;
}
......@@ -69,7 +70,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('请先选择待新增的订单')
message.error(intl.formatMessage({id: 'purchaseOrder.readyAddOrder.error1'}))
}
}
......@@ -129,13 +130,21 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
type='primary'
onClick={clickAdd}
>
新建
{
intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button1'})
}
</Button>
<Button onClick={handleBitchPush} loading={submitLoading}>
{
intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button2'})
}
</Button>
<Button onClick={handleBitchPush} loading={submitLoading}>批量提交</Button>
<DropDeleteDown>
<Menu onClick={(e) => handleMenuClick(e)}>
<Menu.Item key="1" icon={<DeleteOutlined />}>
批量删除
{
intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button3'})
}
</Menu.Item>
</Menu>
</DropDeleteDown>
......@@ -148,7 +157,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
</Card>
<ModalForm
modalTitle='选择下单模式'
modalTitle={intl.formatMessage({id: 'purchaseOrder.readyAddOrder.modalTitle'})}
confirm={onConfirm}
currentRef={currentRef}
actions={approvedActions}
......@@ -164,11 +173,11 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
properties: {
orderMode: {
type: 'string',
title: '选择下单模式',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.modalTitle'}),
required: true,
enum: [],
"x-component-props": {
placeholder: '请选择下单模式'
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.modalTitle'})
}
},
}
......
import React, { useRef } from 'react'
import { baseOrderListColumns } from '../../constant'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import TableOperation from '@/components/TableOperation'
import { postOrderBuyerCreateDelete, postOrderBuyerCreateSubmit } from '@/services/OrderNewV2Api'
// 业务hooks, 待新增订单
export const useSelfTable = () => {
const intl = useIntl()
const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'orderId'})
......@@ -28,12 +29,16 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const buttonGroup = { '提交': true, '修改': record.showUpdate, '删除': true }
const buttonGroup = {
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion1'})]: true,
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion2'})]: record.showUpdate,
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion3'})]: true
}
const operationHandler = {
'提交': () => handleSubmit(record.orderId),
'修改': () => handleEdit(record),
'删除': () => handleDelete(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion1'})]: () => handleSubmit(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion2'})]: () => handleEdit(record),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion3'})]: () => handleDelete(record.orderId),
}
return (
......@@ -49,7 +54,7 @@ export const useSelfTable = () => {
if(alreadyColumns) {
return alreadyColumns.concat([
{
title: '操作',
title: intl.formatMessage({id: 'purchaseOrder.operation'}),
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getPurchaseOrderReadyAddPageSelectOption } from '@/pages/transaction/effect';
import { useIntl } from 'umi';
export const tableListSchema: any = () => {
const intl = useIntl()
const res = getPurchaseOrderReadyAddPageSelectOption()
if(res) {
......@@ -17,7 +19,7 @@ export const tableListSchema: any = () => {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.orderNo'}),
align: 'flex-end',
},
},
......@@ -34,19 +36,19 @@ export const tableListSchema: any = () => {
"digest": {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.digest'}),
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberName'}),
}
},
"orderType": {
type: 'string',
"x-component-props": {
placeholder: '请选择订单类型'
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.orderType'}),
},
enum: OrderType.map(item => ({
label: item['text'],
......@@ -57,13 +59,13 @@ export const tableListSchema: any = () => {
type: 'daterange',
// "x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
placeholder: [intl.formatMessage({id: 'purchaseOrder.readyAddOrder.startDate'}), intl.formatMessage({id: 'purchaseOrder.readyAddOrder.endDate'})],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
children: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.submit'}),
},
},
},
......
import React from 'react'
import { formatTimeString } from '@/utils'
import { Row } from 'antd'
import { useIntl } from 'umi'
const intl = useIntl()
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......@@ -99,50 +102,50 @@ export const orderCombination = {
// 支付方式
export const payTypeLabel = [
{
label: '线上支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel1'}),
value: 1
},
{
label: '线下支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel2'}),
value: 2
},
{
label: '授信支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel3'}),
value: 3
},
{
label: '货到付款',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel4'}),
value: 4
},
]
export const memberColumns: any[] = [
{
title: '会员ID',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.memberId'}),
dataIndex: 'memberId',
align: 'center',
key: 'memberId',
},
{
title: '会员名称',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '公司类型',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.memberTypeName'}),
dataIndex: 'memberTypeName',
align: 'center',
key: 'memberTypeName',
},
{
title: '公司角色',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.roleName'}),
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '公司等级',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.levelTag'}),
dataIndex: 'levelTag',
align: 'center',
key: 'levelTag',
......@@ -151,31 +154,31 @@ export const memberColumns: any[] = [
export const inquiryColumns: any[] = [
{
title: '报价单号',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.quotationNo'}),
dataIndex: 'quotationNo',
align: 'center',
key: 'quotationNo',
},
{
title: '询价单号',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.requisitionFormNo'}),
dataIndex: 'requisitionFormNo',
align: 'center',
key: 'requisitionFormNo',
},
{
title: '报价单摘要',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.quotationSummary'}),
dataIndex: 'quotationSummary',
align: 'center',
key: 'quotationSummary',
},
{
title: '询价会员',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.demandMembers'}),
dataIndex: 'demandMembers',
align: 'center',
key: 'demandMembers',
},
{
title: '单据时间',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.documentsTime'}),
dataIndex: 'documentsTime',
align: 'center',
key: 'documentsTime',
......@@ -185,25 +188,25 @@ export const inquiryColumns: any[] = [
export const paymentInformationColumns: any[] = [
{
title: '支付次数',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payCount'}),
dataIndex: 'payCount',
align: 'center',
key: 'payCount'
},
{
title: '支付环节',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payNode'}),
dataIndex: 'payNode',
align: 'center',
key: 'payNode'
},
{
title: '外部状态',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.externalState'}),
dataIndex: 'externalState',
align: 'center',
key: 'externalState'
},
{
title: '支付比例',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payRatio'}),
dataIndex: 'payRatio',
key: 'payRatio',
editable: true,
......@@ -215,14 +218,14 @@ export const paymentInformationColumns: any[] = [
width: 200
},
{
title: '支付金额',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payPrice'}),
dataIndex: 'payPrice',
align: 'center',
key: 'payPrice',
render: (t) => `¥${t}`
},
{
title: '支付方式',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payWay'}),
dataIndex: 'payWay',
key: 'payWay',
formItem: 'select',
......@@ -234,7 +237,7 @@ export const paymentInformationColumns: any[] = [
width: 200
},
{
title: '支付渠道',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.channel'}),
dataIndex: 'channel',
key: 'channel',
formItem: 'select',
......@@ -253,45 +256,45 @@ export const productInfoColumns: any[] = [
key: 'id',
},
{
title: '商品名称',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '品类',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.customerCategoryName'}),
dataIndex: 'customerCategoryName',
align: 'center',
key: 'customerCategoryName',
},
{
title: '品牌',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.brandName'}),
dataIndex: 'brandName',
align: 'center',
key: 'brandName',
},
{
title: '单位',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.unitName'}),
dataIndex: 'unitName',
align: 'center',
key: 'unitName',
},
{
title: '单价',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.unitPrice'}),
dataIndex: 'unitPrice',
align: 'left',
key: 'unitPrice',
render: text => <PriceComp priceSection={text}/>
},
{
title: '会员折扣',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.memberPrice'}),
dataIndex: 'memberPrice',
align: 'center',
key: 'memberPrice',
render: (text, record) => record.isMemberPrice ? text : null
},
{
title: '采购数量',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.purchaseCount'}),
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
......@@ -300,14 +303,14 @@ export const productInfoColumns: any[] = [
width: 140
},
{
title: '含税',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.none'}),
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
render: () => intl.formatMessage({id: 'purchaseOrder.yes'})
},
{
title: '金额',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.price'}),
dataIndex: 'price',
align: 'center',
key: 'price',
......@@ -315,55 +318,17 @@ export const productInfoColumns: any[] = [
},
// 接口调用
{
title: '配送方式',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.logistics'}),
dataIndex: 'logistics',
align: 'center',
key: 'logistics',
render: text => text.render || ''
},
{
title: '操作',
title: intl.formatMessage({id: 'purchaseOrder.operation'}),
dataIndex: 'ctl',
align: 'center',
key: 'ctl',
},
]
export const mergeOrderColumns: any[] = [
{
title: '订单号',
dataIndex: 'orderNo',
align: 'center',
key: 'orderNo',
},
{
title: '订单摘要',
dataIndex: 'orderThe',
align: 'center',
key: 'orderThe',
},
{
title: '采购商名称',
dataIndex: 'supplyMembersName',
align: 'center',
key: 'supplyMembersName',
},
{
title: '下单时间',
dataIndex: 'createTime',
align: 'center',
key: 'createTime',
},
{
title: '活动时间',
dataIndex: 'none',
align: 'center',
key: 'none',
},
{
title: '活动名称',
dataIndex: 'none',
align: 'center',
key: 'none',
}
]
import React from 'react'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import { Card, Button, Space, Menu, message } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -26,6 +26,7 @@ const fetchTableData = async (params) => {
}
const ReadyAddRequisitionOrder:React.FC<ReadyAddRequisitionOrderProps> = () => {
const intl = useIntl()
const { run: deleteRun } = useHttpRequest(postOrderBuyerCreateDeleteBatch)
const { loading: submitLoading, run: submitRun } = useHttpRequest(postOrderBuyerCreateSubmitBatch)
const { columns, ref, rowSelection, rowSelectionCtl } = useSelfTable()
......@@ -41,7 +42,7 @@ const ReadyAddRequisitionOrder:React.FC<ReadyAddRequisitionOrderProps> = () => {
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('请先选择待新增的订单')
message.error(intl.formatMessage({id: 'purchaseOrder.readyAddOrder.error1'}))
}
break;
}
......@@ -57,7 +58,7 @@ const ReadyAddRequisitionOrder:React.FC<ReadyAddRequisitionOrderProps> = () => {
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('请先选择待新增的订单')
message.error(intl.formatMessage({id: 'purchaseOrder.readyAddOrder.error1'}))
}
}
......@@ -105,13 +106,21 @@ const ReadyAddRequisitionOrder:React.FC<ReadyAddRequisitionOrderProps> = () => {
type='primary'
onClick={clickAdd}
>
新建
{
intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button1'})
}
</Button>
<Button onClick={handleBitchPush} loading={submitLoading}>
{
intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button2'})
}
</Button>
<Button onClick={handleBitchPush} loading={submitLoading}>批量提交</Button>
<DropDeleteDown>
<Menu onClick={(e) => handleMenuClick(e)}>
<Menu.Item key="1" icon={<DeleteOutlined />}>
批量删除
{
intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button3'})
}
</Menu.Item>
</Menu>
</DropDeleteDown>
......
import React, { useRef } from 'react'
import { baseOrderListColumns } from '../../constant'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import TableOperation from '@/components/TableOperation'
import { postOrderBuyerCreateDelete, postOrderBuyerCreateSubmit } from '@/services/OrderNewV2Api'
// 业务hooks, 待新增订单
export const useSelfTable = () => {
const ref = useRef<any>({})
const intl = useIntl()
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'orderId'})
const handleSubmit = async (id) => {
......@@ -26,12 +27,16 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const buttonGroup = { '提交': true, '修改': record.showUpdate, '删除': true }
const buttonGroup = {
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion1'})]: true,
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion2'})]: record.showUpdate,
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion3'})]: true
}
const operationHandler = {
'提交': () => handleSubmit(record.orderId),
'修改': () => handleEdit(record),
'删除': () => handleDelete(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion1'})]: () => handleSubmit(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion2'})]: () => handleEdit(record),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion3'})]: () => handleDelete(record.orderId),
}
return (
......@@ -47,7 +52,7 @@ export const useSelfTable = () => {
if(alreadyColumns) {
return alreadyColumns.concat([
{
title: '操作',
title: intl.formatMessage({id: 'purchaseOrder.operation'}),
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
......
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useIntl } from 'umi';
export const tableListSchema: any = () => {
const intl = useIntl()
return {
type: 'object',
......@@ -9,7 +11,7 @@ export const tableListSchema: any = () => {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.orderNo'}),
align: 'flex-end',
},
},
......@@ -26,25 +28,26 @@ export const tableListSchema: any = () => {
"digest": {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.digest'}),
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberName'}),
}
},
"[startDate,endDate]": {
type: 'daterange',
// "x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
placeholder: [intl.formatMessage({id: 'purchaseOrder.readyAddOrder.startDate'}), intl.formatMessage({id: 'purchaseOrder.readyAddOrder.endDate'})],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
children: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.submit'}),
},
},
},
......
import React from 'react'
import { formatTimeString } from '@/utils'
import { Row } from 'antd'
import { useIntl } from 'umi'
const intl = useIntl()
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......@@ -99,50 +102,50 @@ export const orderCombination = {
// 支付方式
export const payTypeLabel = [
{
label: '线上支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel1'}),
value: 1
},
{
label: '线下支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel2'}),
value: 2
},
{
label: '授信支付',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel3'}),
value: 3
},
{
label: '货到付款',
label: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.payTypeLabel4'}),
value: 4
},
]
export const memberColumns: any[] = [
{
title: '会员ID',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.memberId'}),
dataIndex: 'memberId',
align: 'center',
key: 'memberId',
},
{
title: '会员名称',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '公司类型',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.memberTypeName'}),
dataIndex: 'memberTypeName',
align: 'center',
key: 'memberTypeName',
},
{
title: '公司角色',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.roleName'}),
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '公司等级',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberColumns.levelTag'}),
dataIndex: 'levelTag',
align: 'center',
key: 'levelTag',
......@@ -151,31 +154,31 @@ export const memberColumns: any[] = [
export const inquiryColumns: any[] = [
{
title: '报价单号',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.quotationNo'}),
dataIndex: 'quotationNo',
align: 'center',
key: 'quotationNo',
},
{
title: '询价单号',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.requisitionFormNo'}),
dataIndex: 'requisitionFormNo',
align: 'center',
key: 'requisitionFormNo',
},
{
title: '报价单摘要',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.quotationSummary'}),
dataIndex: 'quotationSummary',
align: 'center',
key: 'quotationSummary',
},
{
title: '询价会员',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.demandMembers'}),
dataIndex: 'demandMembers',
align: 'center',
key: 'demandMembers',
},
{
title: '单据时间',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.inquiryColumns.documentsTime'}),
dataIndex: 'documentsTime',
align: 'center',
key: 'documentsTime',
......@@ -185,25 +188,25 @@ export const inquiryColumns: any[] = [
export const paymentInformationColumns: any[] = [
{
title: '支付次数',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payCount'}),
dataIndex: 'payCount',
align: 'center',
key: 'payCount'
},
{
title: '支付环节',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payNode'}),
dataIndex: 'payNode',
align: 'center',
key: 'payNode'
},
{
title: '外部状态',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.externalState'}),
dataIndex: 'externalState',
align: 'center',
key: 'externalState'
},
{
title: '支付比例',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payRatio'}),
dataIndex: 'payRatio',
key: 'payRatio',
editable: true,
......@@ -215,14 +218,14 @@ export const paymentInformationColumns: any[] = [
width: 200
},
{
title: '支付金额',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payPrice'}),
dataIndex: 'payPrice',
align: 'center',
key: 'payPrice',
render: (t) => `¥${t}`
},
{
title: '支付方式',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.payWay'}),
dataIndex: 'payWay',
key: 'payWay',
formItem: 'select',
......@@ -234,7 +237,7 @@ export const paymentInformationColumns: any[] = [
width: 200
},
{
title: '支付渠道',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.paymentInformationColumns.channel'}),
dataIndex: 'channel',
key: 'channel',
formItem: 'select',
......@@ -253,45 +256,45 @@ export const productInfoColumns: any[] = [
key: 'id',
},
{
title: '商品名称',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '品类',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.customerCategoryName'}),
dataIndex: 'customerCategoryName',
align: 'center',
key: 'customerCategoryName',
},
{
title: '品牌',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.brandName'}),
dataIndex: 'brandName',
align: 'center',
key: 'brandName',
},
{
title: '单位',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.unitName'}),
dataIndex: 'unitName',
align: 'center',
key: 'unitName',
},
{
title: '单价',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.unitPrice'}),
dataIndex: 'unitPrice',
align: 'left',
key: 'unitPrice',
render: text => <PriceComp priceSection={text}/>
},
{
title: '会员折扣',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.memberPrice'}),
dataIndex: 'memberPrice',
align: 'center',
key: 'memberPrice',
render: (text, record) => record.isMemberPrice ? text : null
},
{
title: '采购数量',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.purchaseCount'}),
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
......@@ -300,14 +303,14 @@ export const productInfoColumns: any[] = [
width: 140
},
{
title: '含税',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.none'}),
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
render: () => intl.formatMessage({id: 'purchaseOrder.yes'})
},
{
title: '金额',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.price'}),
dataIndex: 'price',
align: 'center',
key: 'price',
......@@ -315,55 +318,17 @@ export const productInfoColumns: any[] = [
},
// 接口调用
{
title: '配送方式',
title: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.productInfoColumns.logistics'}),
dataIndex: 'logistics',
align: 'center',
key: 'logistics',
render: text => text.render || ''
},
{
title: '操作',
title: intl.formatMessage({id: 'purchaseOrder.operation'}),
dataIndex: 'ctl',
align: 'center',
key: 'ctl',
},
]
export const mergeOrderColumns: any[] = [
{
title: '订单号',
dataIndex: 'orderNo',
align: 'center',
key: 'orderNo',
},
{
title: '订单摘要',
dataIndex: 'orderThe',
align: 'center',
key: 'orderThe',
},
{
title: '采购商名称',
dataIndex: 'supplyMembersName',
align: 'center',
key: 'supplyMembersName',
},
{
title: '下单时间',
dataIndex: 'createTime',
align: 'center',
key: 'createTime',
},
{
title: '活动时间',
dataIndex: 'none',
align: 'center',
key: 'none',
},
{
title: '活动名称',
dataIndex: 'none',
align: 'center',
key: 'none',
}
]
import React from 'react'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import { Card, Button, Space, Menu, message } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -27,6 +27,7 @@ const fetchTableData = async (params) => {
}
const ReadyAddSrmOrder:React.FC<ReadyAddSrmOrderProps> = () => {
const intl = useIntl()
const { run: deleteRun } = useHttpRequest(postOrderBuyerCreateDeleteBatch)
const { loading: submitLoading, run: submitRun } = useHttpRequest(postOrderBuyerCreateSubmitBatch)
const { columns, ref, rowSelection, rowSelectionCtl } = useSelfTable()
......@@ -42,7 +43,7 @@ const ReadyAddSrmOrder:React.FC<ReadyAddSrmOrderProps> = () => {
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('请先选择待新增的订单')
message.error(intl.formatMessage({id: 'purchaseOrder.readyAddOrder.error1'}))
}
break;
}
......@@ -58,7 +59,7 @@ const ReadyAddSrmOrder:React.FC<ReadyAddSrmOrderProps> = () => {
rowSelectionCtl.setSelectedRowKeys([])
}
} else {
message.error('请先选择待新增的订单')
message.error(intl.formatMessage({id: 'purchaseOrder.readyAddOrder.error1'}))
}
}
......@@ -107,13 +108,21 @@ const ReadyAddSrmOrder:React.FC<ReadyAddSrmOrderProps> = () => {
type='primary'
onClick={clickAdd}
>
新建
{
intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button1'})
}
</Button>
<Button onClick={handleBitchPush} loading={submitLoading}>
{
intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button2'})
}
</Button>
<Button onClick={handleBitchPush} loading={submitLoading}>批量提交</Button>
<DropDeleteDown>
<Menu onClick={(e) => handleMenuClick(e)}>
<Menu.Item key="1" icon={<DeleteOutlined />}>
批量删除
{
intl.formatMessage({id: 'purchaseOrder.readyAddOrder.button3'})
}
</Menu.Item>
</Menu>
</DropDeleteDown>
......
import React, { useRef } from 'react'
import { baseOrderListColumns } from '../../constant'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import TableOperation from '@/components/TableOperation'
import { postOrderBuyerCreateDelete, postOrderBuyerCreateSubmit } from '@/services/OrderNewV2Api'
// 业务hooks, 待新增订单
export const useSelfTable = () => {
const intl = useIntl()
const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'orderId'})
......@@ -26,14 +27,17 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const buttonGroup = { '提交': true, '修改': record.showUpdate, '删除': true }
const buttonGroup = {
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion1'})]: true,
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion2'})]: record.showUpdate,
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion3'})]: true
}
const operationHandler = {
'提交': () => handleSubmit(record.orderId),
'修改': () => handleEdit(record),
'删除': () => handleDelete(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion1'})]: () => handleSubmit(record.orderId),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion2'})]: () => handleEdit(record),
[intl.formatMessage({id: 'purchaseOrder.readyAddOrder.useSelfTableOpeartion3'})]: () => handleDelete(record.orderId),
}
return (
<TableOperation
buttonTextFieldMap={buttonGroup}
......@@ -47,7 +51,7 @@ export const useSelfTable = () => {
if(alreadyColumns) {
return alreadyColumns.concat([
{
title: '操作',
title: intl.formatMessage({id: 'purchaseOrder.operation'}),
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getPurchaseOrderReadyAddPageSelectOption } from '@/pages/transaction/effect';
import { ORDER_TYPE_INQUIRYT_PURCHASE } from '@/constants/order';
import { useIntl } from 'umi';
export const tableListSchema: any = () => {
const intl = useIntl()
const res = getPurchaseOrderReadyAddPageSelectOption()
if(res) {
......@@ -18,7 +19,7 @@ export const tableListSchema: any = () => {
type: 'string',
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.orderNo'}),
align: 'flex-end',
},
},
......@@ -35,21 +36,21 @@ export const tableListSchema: any = () => {
"digest": {
type: 'string',
'x-component-props': {
placeholder: '请输入订单摘要',
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.digest'}),
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.memberName'}),
}
},
"orderType": {
type: 'string',
"x-component-props": {
placeholder: '请选择订单类型'
placeholder: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.orderType'}),
},
enum: OrderType.filter(item => item.id !== ORDER_TYPE_INQUIRYT_PURCHASE).map(item => ({
enum: OrderType.map(item => ({
label: item['text'],
value: item['id'],
}))
......@@ -58,13 +59,13 @@ export const tableListSchema: any = () => {
type: 'daterange',
// "x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
placeholder: [intl.formatMessage({id: 'purchaseOrder.readyAddOrder.startDate'}), intl.formatMessage({id: 'purchaseOrder.readyAddOrder.endDate'})],
},
},
submit: {
'x-component': 'Submit',
'x-component-props': {
children: '查询',
children: intl.formatMessage({id: 'purchaseOrder.readyAddOrder.submit'}),
},
},
},
......
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