Commit 3888af92 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: srm/代客下单翻译

parent b69bd9c1
......@@ -117,8 +117,13 @@ export default {
'purchaseOrder.orderCollect.schema.title6' : '其他信息',
'purchaseOrder.orderCollect.schema.pack' : '包装要求',
'purchaseOrder.orderCollect.schema.remark' : '其他要求',
'purchaseOrder.orderCollect.schema.contractNo' : '对应合同编号',
'purchaseOrder.orderCollect.schema.buyerMemberMajorId' : '采购会员',
'purchaseOrder.orderCollect.schema.buyerMemberMajorIdPh' : '请输入搜索采购会员',
'purchaseOrder.orderCollect.memberSchema.placeholder' : '请输入会员名称',
'purchaseOrder.orderCollect.model.message' : '请先选择供应会员',
'purchaseOrder.orderCollect.model.message1' : '请先选择采购询价合同',
'purchaseOrder.orderCollect.model.message2' : '请先选择采购会员',
'purchaseOrder.orderCollect.model.button1' : '选择订单商品',
'purchaseOrder.orderCollect.constant.orderTypeLabel1' : '询价采购',
'purchaseOrder.orderCollect.constant.orderTypeLabel2' : '采购询价合同',
......@@ -157,6 +162,13 @@ export default {
'purchaseOrder.orderCollect.constant.deliveryType2' : '自提',
'purchaseOrder.orderCollect.constant.deliveryType3' : '无需配送',
'purchaseOrder.orderCollect.constant.deliveryType4' : '物流',
'purchaseOrder.orderCollect.constant.code' : '物料编号',
'purchaseOrder.orderCollect.constant.name1' : '物料名称/规格',
'purchaseOrder.orderCollect.constant.relevanceProductId' : '关联报价商品ID/名称/规格/品类/品牌',
'purchaseOrder.orderCollect.constant.price' : '单价',
'purchaseOrder.orderCollect.constant.quantity' : '采购数量',
'purchaseOrder.orderCollect.constant.含税' : '物流',
'purchaseOrder.orderCollect.constant.logistics' : '配送方式',
'purchaseOrder.orderCollect.theInvoiceList.kind1' : '增值税普通发票',
'purchaseOrder.orderCollect.theInvoiceList.kind2' : '增值税专用发票',
'purchaseOrder.orderCollect.theInvoiceList.type1' : '企业',
......@@ -170,6 +182,8 @@ export default {
'purchaseOrder.orderCollect.productTableCell.validator2' : '采购数量仅限三位小数',
'purchaseOrder.orderCollect.productTableCell.validator3' : '数量不小于最小起订数x',
'purchaseOrder.orderCollect.productTableCell.validator4' : 'x必须填写',
'purchaseOrder.orderCollect.productTableCell.validator5' : '单价仅限四位小数',
'purchaseOrder.orderCollect.productTableCell.h3' : '自提地址',
'purchaseOrder.orderCollect.inquiryModalTable.title' : '选择询价报价单',
'purchaseOrder.orderCollect.payInfoCell.validator1' : '请正确输入支付比例',
'purchaseOrder.orderCollect.payInfoCell.validator2' : '支付比例为大于0的整数',
......@@ -251,6 +265,18 @@ export default {
'purchaseOrder.orderCollect.materialColumns.unit' : '单位',
'purchaseOrder.orderCollect.materialColumns.quantity' : '数量',
'purchaseOrder.orderCollect.materialColumns.quantifiable' : '可用数量',
'purchaseOrder.orderCollect.contractColumns.contractNo' : '合同编号',
'purchaseOrder.orderCollect.contractColumns.contractAbstract' : '合同摘要',
'purchaseOrder.orderCollect.contractColumns.startTime' : '合同生效/失效时间',
'purchaseOrder.orderCollect.contractColumns.partyBName' : '合同乙方',
'purchaseOrder.orderCollect.contractColumns.freeAmount' : '合同剩余金额',
'purchaseOrder.orderCollect.contractColumns.sourceType' : '寻源类型',
'purchaseOrder.orderCollect.contractColumns.sourceType1' : '采购询价',
'purchaseOrder.orderCollect.contractColumns.sourceType2' : '采购招标',
'purchaseOrder.orderCollect.contractColumns.sourceType3' : '采购竞价',
'purchaseOrder.orderCollect.contractColumns.sourceNo' : '对应单据',
'purchaseOrder.orderCollect.contractColumns.contractFreeCount' : '合同剩余',
}
......@@ -47,7 +47,7 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
const { form } = useContext(EditableContext);
const intl = useIntl()
const save = async e => {
const save = async () => {
try {
const values = await form.validateFields();
values.purchaseCount = Number(values.purchaseCount) || 0
......
......@@ -128,7 +128,7 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
}
}
const productAddButton = pageStatus === PageStatus.ADD ? <Button onClick={handleShowProduct} block type='default' style={{margin: '24px auto'}}>选择订单商品</Button> : null
const productAddButton = pageStatus === PageStatus.ADD ? <Button onClick={handleShowProduct} block type='default' style={{margin: '24px auto'}}>{intl.formatMessage({id: 'purchaseOrder.orderCollect.model.button1'})}</Button> : null
const productComponents = {
body: {
row: ProductEditableRow,
......
......@@ -174,11 +174,11 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
rules = [
{
required: true,
message: `${title}必须填写`,
message: intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator4'}).replaceAll('x', `${title}`),
},
{
pattern: /^\d+(\.\d{1,4})?$/,
message: '单价仅限四位小数',
message: intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator5'}),
},
{
validator: validatorNumber
......@@ -189,7 +189,7 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
rules = [
{
required: true,
message: `${title}必须填写`,
message: intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator4'}).replaceAll('x', `${title}`),
},
{
validator: validatorNumber
......@@ -238,7 +238,7 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
<h3><EnvironmentOutlined/> {intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.h3'})}</h3>
{
receiveInfo && <>
<p>{receiveInfo.shipperName} / {receiveInfo.phone}</p>
......
......@@ -6,6 +6,7 @@ import './index.less'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
import { getManageAreaByPcode, GetManageAreaByPcodeRequest, getManageCountryAreaGetTelCode } from '@/services/ManageV2Api'
import { postLogisticsReceiverAddressAdd, postLogisticsReceiverAddressUpdate } from '@/services/LogisticsV2Api'
import { getIntl } from 'umi'
export interface AddressModalProps {
mode: 'add' | 'edit' | 'preview' | 'default',
......@@ -15,9 +16,9 @@ export interface AddressModalProps {
}
const titleMaps = {
add: '新建收货地址',
edit: '编辑收货地址',
preview: '查看收货地址'
add: getIntl().formatMessage({id: 'purchaseOrder.add'}),
edit: getIntl().formatMessage({id: 'purchaseOrder.edit'}),
preview: getIntl().formatMessage({id: 'purchaseOrder.view'}),
}
const addressSchemaAction = createFormActions()
......
import { ISchema } from "@formily/antd";
import { PATTERN_MAPS } from '@/constants/regExp';
import { getIntl } from "umi";
const addressSchema: ISchema = {
type: 'object',
......@@ -13,11 +14,11 @@ const addressSchema: ISchema = {
properties: {
receiverName: {
type: 'string',
title: '收货人',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.receiverName'}),
"x-rules": [
{
required: true,
message: '请输入收货人姓名'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.receiverNameMessage'}),
},
{
limitByte: true,
......@@ -30,7 +31,7 @@ const addressSchema: ISchema = {
"x-component": 'mega-layout',
"x-component-props": {
grid: true,
label: '收货地区',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.label1'}),
required: true,
columns: 4,
enableSafeWidth: false,
......@@ -42,7 +43,7 @@ const addressSchema: ISchema = {
enum: [],
required: true,
"x-component-props": {
placeholder: '-省份/直辖市-'
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.provinceCodePh'}),
},
"x-mega-props": {
span: 1
......@@ -61,7 +62,7 @@ const addressSchema: ISchema = {
enum: [],
required: true,
"x-component-props": {
placeholder: '-市-'
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.cityCodePh'}),
},
"x-mega-props": {
span: 1
......@@ -80,7 +81,7 @@ const addressSchema: ISchema = {
enum: [],
required: true,
"x-component-props": {
placeholder: '-区/县-'
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.districtCodePh'}),
},
"x-mega-props": {
span: 1
......@@ -91,7 +92,7 @@ const addressSchema: ISchema = {
enum: [],
// required: true,
"x-component-props": {
placeholder: '-街道/乡/镇-'
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.streetCodePh'}),
},
"x-mega-props": {
span: 1
......@@ -104,13 +105,13 @@ const addressSchema: ISchema = {
"x-component": 'textarea',
"x-component-props": {
rows: 3,
placeholder: '请填写详细地址、路名、门牌号等'
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.addressPh'}),
},
title: '详细地址',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.address'}),
"x-rules": [
{
required: true,
message: '请输入详细地址'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.addressMessage'}),
},
{
limitByte: true,
......@@ -120,7 +121,7 @@ const addressSchema: ISchema = {
},
postalCode: {
type: 'string',
title: '邮编',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.postalCode'}),
"x-rules": [
{
limitByte: true,
......@@ -133,7 +134,7 @@ const addressSchema: ISchema = {
"x-component": 'mega-layout',
"x-component-props": {
grid: true,
label: '手机号',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.label2'}),
columns: 6,
enableSafeWidth: false,
className: 'noMarbottom',
......@@ -152,7 +153,7 @@ const addressSchema: ISchema = {
"x-rules": [
{
required: true,
message: '请选择区号'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.areaCodeMessage'}),
}
]
},
......@@ -164,26 +165,26 @@ const addressSchema: ISchema = {
"x-rules": [
{
pattern: PATTERN_MAPS.phone,
message: '请输入正确的手机号'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.phoneMessage1'}),
},
{
required: true,
message: '请输入手机号'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.phoneMessage2'}),
}
],
"x-component-props": {
placeholder: '输入你的手机号码',
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.phonePh'}),
style: { width: '100%' }
}
}
}
},
tel: {
title: '电话号码',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.tel'}),
type: 'string'
},
isDefault: {
title: '是否默认',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.isDefault'}),
type: 'boolean',
"x-mega-props": {
wrapperWidth: 36
......
......@@ -6,6 +6,7 @@ import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'
import { contractColumns } from '../../constant'
import { OrderModalType } from '@/constants/order'
import { getContractManagePageCompleteList } from '@/services/ContractV2Api'
import { useIntl } from 'umi'
export interface ContractModalTableProps extends ModalTableProps {
type?: 'radio' | 'checkbox',
......@@ -18,7 +19,7 @@ export interface ContractModalTableProps extends ModalTableProps {
const ContractModalTable:React.FC<ContractModalTableProps> = (props) => {
const { type = 'radio', schemaAction, confirmModal, currentRef, ...restProps } = props
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type})
const intl = useIntl()
const [originType, setOriginType] = useState<number>()
useEffect(() => {
......@@ -107,7 +108,7 @@ const ContractModalTable:React.FC<ContractModalTableProps> = (props) => {
}
return (
<ModalTable
modalTitle='选择采购合同'
modalTitle={intl.formatMessage({id: 'purchaseOrder.orderCollect.requisition.button1'})}
columns={contractColumns}
visible={visible}
confirm={handleConfirm}
......
......@@ -4,6 +4,7 @@ import { createFormActions } from '@formily/antd'
import addressSchema from './schema'
import './index.less'
import { postSettleAccountsInvoiceMessageAdd, postSettleAccountsInvoiceMessageUpdate } from '@/services/SettleV2Api'
import { getIntl } from 'umi'
export interface InvoiceModalProps {
mode: 'add' | 'edit' | 'preview' | 'default' | 'delete',
......@@ -14,11 +15,10 @@ export interface InvoiceModalProps {
const schemaActions = createFormActions()
const modelTitle = {
'add': '新增发票',
'edit': "编辑发票",
'preview': '查看发票'
'add': getIntl().formatMessage({id: 'purchaseOrder.add'}),
'edit': getIntl().formatMessage({id: 'purchaseOrder.edit'}),
'preview': getIntl().formatMessage({id: 'purchaseOrder.view'})
}
const InvoiceModal:React.FC<InvoiceModalProps> = (props) => {
const { mode, formInitValue } = props
......
import { ISchema } from "@formily/antd";
import { PATTERN_MAPS } from '@/constants/regExp';
import { getIntl } from "umi";
const addressSchema: ISchema = {
type: 'object',
......@@ -17,14 +18,14 @@ const addressSchema: ISchema = {
type: {
type: 'radio',
required: true,
title: '开具类型',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.type'}),
enum: [
{
label: '企业(默认)',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.type1'}),
value: 1
},
{
label: '个人',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.type2'}),
value: 2
}
],
......@@ -40,14 +41,14 @@ const addressSchema: ISchema = {
kind: {
type: 'radio',
required: true,
title: '发票种类',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.kind'}),
enum: [
{
label: '增值税普通发票(默认)',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.kind1'}),
value: 1
},
{
label: '增值税专用发票',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.kind2'}),
value: 2
}
],
......@@ -56,11 +57,11 @@ const addressSchema: ISchema = {
invoiceTitle: {
type: 'string',
required: true,
title: '发票抬头',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.invoiceTitle'}),
"x-rules": [
{
required: true,
message: '请输入发票抬头'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.invoiceTitleMessage'}),
},
{
limitByte: true,
......@@ -71,11 +72,11 @@ const addressSchema: ISchema = {
taxNo: {
type: 'string',
required: true,
title: '纳税号',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.taxNo'}),
"x-rules": [
{
required: true,
message: '请输入纳税号'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.taxNoMessage'}),
},
{
limitByte: true,
......@@ -85,7 +86,7 @@ const addressSchema: ISchema = {
},
bankOfDeposit: {
type: 'string',
title: '开户行',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.bankOfDeposit'}),
"x-rules": [
{
limitByte: true,
......@@ -95,12 +96,12 @@ const addressSchema: ISchema = {
},
account: {
type: 'string',
title: '账号',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.account'}),
maxLength: 20
},
address: {
type: 'string',
title: '地址',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.address'}),
"x-rules": [
{
limitByte: true,
......@@ -110,16 +111,16 @@ const addressSchema: ISchema = {
},
tel: {
type: 'string',
title: '电话号码',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.tel'}),
"x-rules": [
{
pattern: PATTERN_MAPS.tel,
message: '请输入正确的电话号码'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.telMessage'}),
}
]
},
isDefault: {
title: '是否默认',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.isDefault'}),
type: 'boolean',
"x-mega-props": {
wrapperWidth: 36
......
......@@ -7,6 +7,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import { addContractOrderModalSchema } from '@/components/ModalTable/schema'
import Search from '@/components/NiceForm/components/Search'
import Submit from '@/components/NiceForm/components/Submit';
import { getIntl } from 'umi'
export interface MaterialModalTableProps extends ModalTableProps {
type?: 'radio' | 'checkbox',
......@@ -24,53 +25,47 @@ export const materialColumns: any[] = [
key: 'id',
},
{
title: '物料编号',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.materialColumns.productNo'}),
dataIndex: 'materielNo',
align: 'center',
key: 'materielNo',
},
{
title: '规格型号',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.materialColumns.spec'}),
dataIndex: 'type',
align: 'center',
key: 'type',
},
{
title: '物料名称',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.materialColumns.name'}),
dataIndex: 'materielName',
align: 'center',
key: 'materielName',
},
{
title: '品类',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.materialColumns.category'}),
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.materialColumns.brand'}),
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.materialColumns.unit'}),
dataIndex: 'unit',
align: 'center',
key: 'unit'
},
{
title: '合同剩余',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.contractColumns.contractFreeCount'}),
dataIndex: 'contractFreeCount',
align: 'center',
key: 'contractFreeCount'
},
// {
// title: '供方库存',
// dataIndex: 'supplierInventory',
// align: 'center',
// key: 'supplierInventory'
// },
]
const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
......@@ -147,7 +142,7 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
return (
<ModalTable
modalTitle='选择采购物料'
modalTitle={getIntl().formatMessage({id: 'purchaseOrder.orderCollect.requisition.button'})}
width={900}
columns={materialColumns}
visible={visible}
......
......@@ -2,6 +2,7 @@ import React, { useState, useRef, useContext } from 'react'
import { Form, Input, Select, Popover, Row } from 'antd';
import { EnvironmentOutlined } from '@ant-design/icons';
import { getLogisticsSelectListMemberShipperAddress } from '@/services/LogisticsV2Api';
import { useIntl } from 'umi';
export interface MaterialTableCellProps {
title: React.ReactNode;
......@@ -47,7 +48,7 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
}) => {
const formItemRef = useRef<any>();
const { form } = useContext(EditableContext);
const intl = useIntl()
// 是否显示地址
const [showAddress, setShowAddress] = useState<boolean>(false)
// 地址信息
......@@ -114,7 +115,19 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
onChange={(value, option) => change(value, option, dataIndex)}
id={dataIndex + record.id}
className="purchase_logistic_select"
options={[{ label: '物流', value: 1 }, { label: '自提', value: 2 }, { label: '无需配送', value: 3 }]}
options={[
{
label: intl.formatMessage({id: 'purchaseOrder.orderCollect.constant.deliveryType4'}),
value: 1
},
{
label: intl.formatMessage({id: 'purchaseOrder.orderCollect.constant.deliveryType2'}),
value: 2
},
{
label: intl.formatMessage({id: 'purchaseOrder.orderCollect.constant.deliveryType3'}),
value: 3
}]}
{...formItemProps}
/>
}
......@@ -126,10 +139,10 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
try {
let _value = Number(value)
if(isNaN(_value) || _value < Number(record["minOrder"])) {
throw new Error(`数量不小于最小起订数${record["minOrder"]}`)
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator3'}).replaceAll('x', record["minOrder"]))
}
if(_value > Number.MAX_SAFE_INTEGER) {
throw new Error('数值精度溢出')
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator1'}))
}
callback()
} catch (err) {
......@@ -147,11 +160,11 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
rules={dataIndex === 'purchaseCount' ? [
{
required: true,
message: `${title}必须填写`,
message: intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator4'}).replaceAll('x', `${title}`),
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '采购数量仅限三位小数',
message: intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator2'}),
},
{
validator: validatorNumber
......@@ -159,7 +172,7 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
] : [
{
required: true,
message: `${title}必须填写`,
message: intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator4'}).replaceAll('x', `${title}`),
}
]}
>
......@@ -171,7 +184,7 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
<Popover content={
<Row>
<div>
<h3><EnvironmentOutlined/> 自提地址</h3>
<h3><EnvironmentOutlined/> {intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.h3'})}</h3>
{
receiveInfo && <>
<p>{receiveInfo.shipperName} / {receiveInfo.phone}</p>
......
......@@ -7,6 +7,7 @@ import cx from 'classnames'
import AddressModal from '../addressModal'
import { fetchOrderApi } from '../../apis'
import { getLogisticsReceiverAddressGet, postLogisticsReceiverAddressDelete } from '@/services/LogisticsV2Api'
import { useIntl } from 'umi'
const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)`
.select_style_border {
......@@ -50,6 +51,7 @@ const transformDefaultData = (data: any[]) => {
}
const SelectAddress = (props: ISchemaFieldComponentProps) => {
const intl = useIntl()
const [formInitValue, setFormInitValue] = useState<any>(null)
const [mode, setMode] = useState<'add' | 'edit' | 'default'>('default')
const [state, setFieldState] = useFieldState({
......@@ -128,7 +130,7 @@ const SelectAddress = (props: ISchemaFieldComponentProps) => {
<Col>{v.receiverName}</Col>
<Col> / </Col>
<Col>{v.phone}</Col>
{v.isDefault ? <Col style={{ marginLeft: 6 }}><Tag color='default'>默认</Tag></Col> : null}
{v.isDefault ? <Col style={{ marginLeft: 6 }}><Tag color='default'>{intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.type1'})}</Tag></Col> : null}
</Row>
<div style={{ color: '#909399' }}>{v.fullAddress}</div>
</div>
......@@ -150,13 +152,13 @@ const SelectAddress = (props: ISchemaFieldComponentProps) => {
style={{width: '100%', height: '100%', borderStyle: "dashed"}}
onClick={handleAdd}
>
<p style={{width: '100%', textAlign: 'center'}}><PlusOutlined />&nbsp;新增地址</p>
<p style={{width: '100%', textAlign: 'center'}}><PlusOutlined />&nbsp;{intl.formatMessage({id: 'purchaseOrder.orderCollect.selectAddress.add'})}</p>
</div>
</Col>}
</Row></SelectStyles>
{transformData.length > 3 &&
<div onClick={toogleMore} style={{ textAlign: 'center', cursor: 'pointer', color: '#00b37a' }}>
显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
{intl.formatMessage({id: 'purchaseOrder.more'})}{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
</div>
}
<AddressModal mode={mode} formInitValue={formInitValue} currentRef={modalRef} reloadAddress={reloadAddress} />
......
......@@ -8,8 +8,10 @@ import InvoiceModal from '../invoiceModal'
import styles from './index.less'
import { PageStatus, usePageStatus } from '@/hooks/usePageStatus'
import { getSettleAccountsInvoiceMessageDetails, postSettleAccountsInvoiceMessageDelete, postSettleAccountsInvoiceMessageUpdate } from '@/services/SettleV2Api'
import { useIntl } from 'umi'
const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
const intl = useIntl()
const [formInitValue, setFormInitValue] = useState<any>(null)
const [mode, setMode] = useState<'add' | 'edit' | 'default' | 'preview' | 'delete'>('default')
const modalRef = useRef<any>({})
......@@ -162,13 +164,13 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
<Radio className={styles.list_radio} value={item} key={`address_list_radio_${item?.id}`}>
<div className={styles.invoice_list_item} key={`invoice_list_item_${index}`}>
<div className={styles.invoice_list_item_content}>
<div className={cx(styles.invoice_list_item_content_tag, item.kind !== 1 ? styles.special : '')}>{item.kind === 1 ? '增值税普通发票' : '增值税专用发票'}</div>
<div className={cx(styles.invoice_list_item_content_tag, item.kind !== 1 ? styles.special : '')}>{item.kind === 1 ? intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.kind1'}) : intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.kind2'})}</div>
<div className={styles.invoice_list_item_content_name}>
<span>{item.invoiceTitle}</span>
<span>({item.type === 1 ? '企业' : '个人'})</span>
<span>({item.type === 1 ? intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.type1'}) : intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.type2'})})</span>
{
item.isDefault === 1 ? <div className={styles.default}>默认</div> :
<div className={styles.set_default} onClick={e => handleSetDefault(item, e)}>设为默认</div>
item.isDefault === 1 ? <div className={styles.default}>{intl.formatMessage({id: 'purchaseOrder.default'})}</div> :
<div className={styles.set_default} onClick={e => handleSetDefault(item, e)}>{intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.default2'})}</div>
}
</div>
</div>
......@@ -176,12 +178,12 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
useValue?.id === item?.id && (
editable ?
<div className={styles.invoice_list_item_btn_group}>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleEdit(item, e)}>编辑</div>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleDelete(item?.id, e)}>删除</div>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleEdit(item, e)}>{intl.formatMessage({id: 'purchaseOrder.edit'})}</div>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleDelete(item?.id, e)}>{intl.formatMessage({id: 'purchaseOrder.delete'})}</div>
</div>
:
<div className={styles.invoice_list_item_btn_group}>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleEdit(item, e, 'preview')}>查看</div>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleEdit(item, e, 'preview')}>{intl.formatMessage({id: 'purchaseOrder.view'})}</div>
</div>
)
}
......@@ -195,7 +197,7 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
style={{width: '100%', height: '100%', borderStyle: "dashed"}}
onClick={handleAdd}
>
<p style={{width: '100%', textAlign: 'center', fontSize: 12, marginTop: 14}}><PlusOutlined />&nbsp;新增发票</p>
<p style={{width: '100%', textAlign: 'center', fontSize: 12, marginTop: 14}}><PlusOutlined />&nbsp;{intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.add'})}</p>
</div>
</Col> }
</Row>
......@@ -203,7 +205,7 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
</Radio.Group>
{ transformData.length > 3 &&
<div onClick={toogleMore} style={{textAlign: 'center', cursor: 'pointer', color: '#00b37a'}}>
显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined/>}
{intl.formatMessage({id: 'purchaseOrder.more'})}{showMore ? <CaretDownOutlined /> : <CaretUpOutlined/>}
</div>
}
......
import React from 'react'
import { formatTimeString } from '@/utils'
import { Row } from 'antd'
import { OrderModalType } from '@/constants/order'
import { getIntl } from 'umi'
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......@@ -116,40 +116,40 @@ export const orderCombination = {
export const orderTypeLabelMap = {
'3': '询价采购',
'12': '采购询价合同',
'13': '采购竞价合同',
'14': '采购招标合同',
'3': getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.orderTypeLabel1'}),
'12': getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.orderTypeLabel2'}),
'13': getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.orderTypeLabel3'}),
'14': getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.orderTypeLabel4'}),
}
export const memberColumns: any[] = [
{
title: '会员ID',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.memberId'}),
dataIndex: 'memberId',
align: 'center',
key: 'memberId',
},
{
title: '会员名称',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '公司类型',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.memberTypeName'}),
dataIndex: 'memberTypeName',
align: 'center',
key: 'memberTypeName',
},
{
title: '公司角色',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.roleName'}),
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '公司等级',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.levelTag'}),
dataIndex: 'levelTag',
align: 'center',
key: 'levelTag',
......@@ -158,31 +158,31 @@ export const memberColumns: any[] = [
export const inquiryColumns: any[] = [
{
title: '报价单号',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.quotationNo'}),
dataIndex: 'quotationNo',
align: 'center',
key: 'quotationNo',
},
{
title: '询价单号',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.inquiryListNo'}),
dataIndex: 'inquiryListNo',
align: 'center',
key: 'inquiryListNo',
},
{
title: '报价单摘要',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.details'}),
dataIndex: 'details',
align: 'center',
key: 'details',
},
{
title: '报价会员',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.offerMemberName'}),
dataIndex: 'offerMemberName',
align: 'center',
key: 'offerMemberName',
},
{
title: '单据时间',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.voucherTime'}),
dataIndex: 'voucherTime',
align: 'center',
key: 'voucherTime',
......@@ -199,44 +199,44 @@ export const contractColumns: any[] = [
className: 'commonHide'
},
{
title: '合同编号',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.contractColumns.contractNo'}),
dataIndex: 'contractNo',
key: 'contractNo',
},
{
title: '合同摘要',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.contractColumns.contractAbstract'}),
dataIndex: 'contractAbstract',
key: 'contractAbstract',
},
{
title: '合同生效/失效时间',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.contractColumns.startTime'}),
dataIndex: 'startTime',
key: 'startTime',
render: (t, r) => <><p>{t}</p><p>{r.endTime}</p></>
},
{
title: '合同乙方',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.contractColumns.contractNo'}),
dataIndex: 'partyBName',
key: 'partyBName',
},
{
title: '合同剩余金额',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.contractColumns.freeAmount'}),
dataIndex: 'freeAmount',
key: 'freeAmount',
render: (t) => `¥${t.toFixed(2)}`
},
{
title: '寻源类型',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.contractColumns.sourceType'}),
dataIndex: 'sourceType',
key: 'sourceType',
render: (t, r) => {
if(t === 1) return '采购询价'
if(t === 2) return '采购招标'
if(t === 3) return '采购竞价'
if(t === 1) return getIntl().formatMessage({id: 'purchaseOrder.orderCollect.contractColumns.sourceType1'})
if(t === 2) return getIntl().formatMessage({id: 'purchaseOrder.orderCollect.contractColumns.sourceType2'})
if(t === 3) return getIntl().formatMessage({id: 'purchaseOrder.orderCollect.contractColumns.sourceType3'})
}
},
{
title: '对应单据',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.contractColumns.sourceNo'}),
dataIndex: 'sourceNo',
key: 'sourceNo',
}
......@@ -251,66 +251,53 @@ export const materialInfoColumns: any[] = [
key: 'id',
className: 'commonHide'
},
// {
// title: '物料ID',
// dataIndex: 'materialId',
// align: 'center',
// key: 'materialId',
// className: 'commonHide'
// },
{
title: '物料编号',
{
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.code'}),
dataIndex: 'code',
align: 'center',
key: 'code',
},
{
title: '物料名称/规格',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.name1'}),
dataIndex: 'name',
align: 'center',
key: 'name',
render: (t, r) => `${t}/${r.type}`
},
{
title: '品类',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.category'}),
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.brand'}),
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.unit'}),
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
{
title: '关联报价商品ID/名称/规格/品类/品牌',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.relevanceProductId'}),
dataIndex: 'relevanceProductId',
align: 'center',
key: 'relevanceProductId',
render: (t, r) => t ? `${t}/${r.relevanceProductName || ''}/${r.relevanceProductType || ''}/${r.relevanceProductCategory || ''}/${r.relevanceProductBrand || ''}` : ''
},
{
title: '单价',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.price'}),
dataIndex: 'price',
align: 'left',
key: 'price',
render: (t) => `¥${t.toFixed(2)}`
},
// {
// title: '供方库存',
// dataIndex: 'stock',
// align: 'center',
// key: 'stock',
// },
{
title: '采购数量',
{
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.quantity'}),
dataIndex: 'quantity',
align: 'center',
key: 'quantity',
......@@ -319,21 +306,21 @@ export const materialInfoColumns: any[] = [
// width: 80
},
{
title: '含税',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.tax'}),
dataIndex: 'tax',
align: 'center',
key: 'tax',
render: (t, r) => t ? '是' : '否'
render: (t, r) => t ? getIntl().formatMessage({id: 'purchaseOrder.yes'}) : getIntl().formatMessage({id: 'purchaseOrder.no'})
},
{
title: '税率',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.taxRate'}),
dataIndex: 'taxRate',
align: 'center',
key: 'taxRate',
render: (t, r) => t ? `${t}%` : null
},
{
title: '金额',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.amount'}),
dataIndex: 'amount',
align: 'center',
key: 'amount',
......@@ -341,7 +328,7 @@ export const materialInfoColumns: any[] = [
},
// 接口调用
{
title: '配送方式',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.logistics'}),
dataIndex: 'logistics',
align: 'center',
key: 'logistics',
......@@ -349,7 +336,7 @@ export const materialInfoColumns: any[] = [
editable: true,
},
{
title: '操作',
title: getIntl().formatMessage({id: 'purchaseOrder.operation'}),
dataIndex: 'ctl',
align: 'center',
key: 'ctl',
......
import React, { useRef, useState, useEffect } from 'react'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'
import { Button, Row, Col, message } from 'antd'
import { createFormActions, registerVirtualBox, useFormSpy } from '@formily/antd'
......@@ -55,6 +55,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
const data = form.getFieldValue('products')
const sum = data.reduce((prev, next) => (prev*100 + (next.amount || 0)*100)/100, 0)
const [freePrice, setFreePrice] = useState<number>(0)
const intl = useIntl()
useEffect(() => {
if (sum + freePrice) {
......@@ -64,11 +65,11 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
return <RowStyle>
<Col span={2}>
<div>合计金额</div>
<div>{intl.formatMessage({id: 'purchaseOrder.orderCollect.title1'})}</div>
<div>{`¥${sum.toFixed(2)}`}</div>
</Col>
<Col span={2}>
<div>总计金额</div>
<div>{intl.formatMessage({id: 'purchaseOrder.orderCollect.title3'})}</div>
<div>{`¥${(sum + freePrice).toFixed(2)}`}</div>
</Col>
</RowStyle>
......@@ -77,6 +78,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
/** 采购订单SRM下单 有选择采购合同和显示物料 */
const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const shopDataRef = useRef<any>({})
const intl = useIntl()
const contractOrderRef = useRef<any>({}) // 合同下单选采购合同
const [formLoading, setFormLoading] = useState(false)
const [btnLoading, setBtnLoading] = useState(false)
......@@ -130,7 +132,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const params = { ...value }
console.log(value)
if(formContext.innerFormErrors) {
throw new Error('请完善订单物料数据')
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.error7'}))
}
// 校验采购数量
const judgementByCount = params.products?.length && params.products.map(item => {
......@@ -141,11 +143,11 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
}
})
if(!judgementByCount || judgementByCount.includes(false)){
throw new Error('请填写商品采购数量')
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.error4'}))
}
// 使用发票即校验发票id
if(params.hasInvoice && !params.theInvoiceId) {
throw new Error('请新增或选择需要使用的发票')
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.error5'}))
}
setBtnLoading(true)
......@@ -221,7 +223,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
defaultConsignee: addressDetail.isDefault,
}
} else {
throw new Error('交付地址异常')
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.error9'}))
}
// 其他需求
......@@ -256,10 +258,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
contractOrderRef.current.setVisible(true)
}
const orderContract = pageStatus === PageStatus.ADD && <div className='connectBtn' onClick={handleOrderContract}><LinkOutlined style={{marginRight: 4}}/>选择</div>
const orderContract = pageStatus === PageStatus.ADD && <div className='connectBtn' onClick={handleOrderContract}><LinkOutlined style={{marginRight: 4}}/>{intl.formatMessage({id: 'purchaseOrder.orderCollect.button1'})}</div>
// 新增收货地址
const addNewAddress = <Button block icon={<PlusOutlined/>}>新增收货地址</Button>
const addNewAddress = <Button block icon={<PlusOutlined/>}>{intl.formatMessage({id: 'purchaseOrder.orderCollect.button3'})}</Button>
const providerValue = {
// detailData: initFormValue,
......@@ -270,11 +272,11 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
return (<div style={{margin: -24}}>
<FormDetailContext.Provider value={providerValue}>
<FormDetailHeader
title={id?"编辑":"新增"}
title={id?intl.formatMessage({id: 'purchaseOrder.edit'}):intl.formatMessage({id: 'purchaseOrder.add'})}
schema={initFormSchema}
extraRight={[
<Button key="1" onClick={() => addSchemaAction.submit()} loading={btnLoading} type="primary" icon={<SaveOutlined />}>
保存
{intl.formatMessage({id: 'purchaseOrder.save'})}
</Button>,
]}
/>
......
......@@ -5,6 +5,7 @@ import { materialInfoColumns } from '../constant';
import MaterialTableCell, { MaterialEditableRow } from '../components/materialTableCell';
import { useModalTable } from './useModalTable';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { useIntl } from 'umi';
let orderMode = null;
......@@ -28,6 +29,7 @@ export const getUnitPriceTotal = (record) => {
*/
export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
const materialRef = useRef<any>({})
const intl = useIntl()
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type: 'checkbox'})
orderMode = ctx.getFieldValue('orderMode')
......@@ -51,7 +53,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
const tempColumn = [...materialInfoColumns]
if (pageStatus === PageStatus.ADD) {
// 渲染操作
tempColumn[tempColumn.length - 1].render = (text, record) => <Button type='link' onClick={() => handleDelete(record)}>删除</Button>
tempColumn[tempColumn.length - 1].render = (text, record) => <Button type='link' onClick={() => handleDelete(record)}>{intl.formatMessage({id: 'purchaseOrder.delete'})}</Button>
// 渲染单价
tempColumn[7].render = (t, r) => <span style={{color: 'red'}}>{Number(r.price).toFixed(2)}</span>
} else {
......@@ -71,11 +73,11 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
materialRef.current.setVisible(true)
materialRef.current.rowSelectionCtl.setSelectedRowKeys(() => products.map(item => item.id))
} else {
message.error('请先选择采购询价合同')
message.error(intl.formatMessage({id: 'purchaseOrder.orderCollect.model.message1'}))
}
}
const materialAddButton = <Button onClick={handleShowMaterial} block type='default' style={{margin: '24px auto'}}>选择采购物料</Button>
const materialAddButton = <Button onClick={handleShowMaterial} block type='default' style={{margin: '24px auto'}}>{intl.formatMessage({id: 'purchaseOrder.orderCollect.requisition.button'})}</Button>
const materialComponents = {
body: {
row: MaterialEditableRow,
......
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
import moment from 'moment'
// 基本信息
......@@ -7,7 +8,7 @@ const basicInfo: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '基本信息',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.title1'}),
id: 'basicInfo'
},
properties: {
......@@ -28,7 +29,7 @@ const basicInfo: ISchema = {
type: 'string',
required: true,
enum: [],
title: '下单模式',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.orderMode'}),
"x-linkages": [
// 联动显示合同编号字段
{
......@@ -59,11 +60,11 @@ const basicInfo: ISchema = {
},
digest: {
type: 'string',
title: '订单摘要',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.digest'}),
"x-rules": [
{
required: true,
message: '请输入订单摘要'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.digestMessage'}),
},
{
limitByte: true,
......@@ -73,7 +74,7 @@ const basicInfo: ISchema = {
},
contractNo: {
type: 'string',
title: '对应合同编号',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.contractNo'}),
visible: false,
"x-component-props": {
disabled: true,
......@@ -94,7 +95,7 @@ const basicInfo: ISchema = {
},
vendorMemberName: {
type: 'string',
title: '供应会员',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.vendorMemberName'}),
"x-component-props": {
disabled: true,
},
......@@ -125,8 +126,8 @@ const basicInfo: ISchema = {
},
type: {
type: 'string',
title: '订单类型',
"x-component": 'text'
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.type'}),
"x-component": 'text',
},
createTime: {
type: 'string',
......@@ -160,7 +161,7 @@ export const orderMaterial: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '订单物料',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.requisition.requisitionMaterial'}),
id: 'orderProudcts'
},
properties: {
......@@ -194,7 +195,7 @@ const submitInfo: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '送货信息',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.title4'}),
id: 'deliveryInfo'
},
properties: {
......@@ -218,7 +219,7 @@ const submitInfo: ISchema = {
deliverDate: {
type: 'string',
"x-component": 'date',
title: '送货日期',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.deliverDate'}),
required: true,
"x-component-props": {
showTime: true,
......@@ -253,10 +254,10 @@ const submitInfo: ISchema = {
"x-rules": [
{
required: true,
message: '请选择送货地址'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.deliveryAddresIdMessage'}),
}
],
title: '送货地址'
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.deliveryAddresId'}),
}
}
},
......@@ -271,7 +272,7 @@ const invoiceInfo: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '发票信息',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.title5'}),
id: 'invoiceInfo'
},
properties: {
......@@ -292,12 +293,12 @@ const invoiceInfo: ISchema = {
type: 'boolean',
"x-component": 'CheckboxSingle',
"x-component-props": {
children: '需要发票',
children: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.hasInvoiceChildren'}),
style: {
marginTop: 4,
}
},
title: '发票',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.hasInvoice'}),
default: false,
"x-linkages": [
{
......@@ -336,7 +337,7 @@ const ortherInfo: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '其他信息',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.title6'}),
id: 'otherInfo'
},
properties: {
......@@ -359,7 +360,7 @@ const ortherInfo: ISchema = {
"x-component-props": {
rows: 1
},
title: '包装要求',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.pack'}),
"x-rules": [
{
limitByte: true,
......@@ -373,7 +374,7 @@ const ortherInfo: ISchema = {
"x-component-props": {
rows: 1
},
title: '其他要求',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.remark'}),
"x-rules": [
{
limitByte: true,
......
import { ISchema } from '@formily/antd';
export const memberSchema: ISchema = {
type: 'object',
properties: {
name: {
type: 'string',
"x-component": 'Search',
"x-component-props": {
placeholder: '请输入会员名称'
}
}
}
}
......@@ -8,6 +8,7 @@ import { getManageCountryAreaGetTelCode } from '@/services/ManageV2Api'
import { postLogisticsReceiverAddressAgentAdd, postLogisticsReceiverAddressAgentUpdate } from '@/services/LogisticsV2Api'
import { getManageAreaByPcode, GetManageAreaByPcodeRequest } from '@/services/ManageV2Api'
import { message } from 'antd'
import { getIntl } from 'umi'
export interface AddressModalProps {
mode: 'add' | 'edit' | 'preview' | 'default',
......@@ -18,11 +19,12 @@ export interface AddressModalProps {
}
const titleMaps = {
add: '新建收货地址',
edit: '编辑收货地址',
preview: '查看收货地址'
add: getIntl().formatMessage({id: 'purchaseOrder.add'}),
edit: getIntl().formatMessage({id: 'purchaseOrder.edit'}),
preview: getIntl().formatMessage({id: 'purchaseOrder.view'}),
}
const addressSchemaAction = createFormActions()
// 获取手机区号
const fetchTelCode = async () => {
......@@ -74,7 +76,7 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
props.currentRef.current.setVisible(false)
props.reloadAddress && props.reloadAddress()
} else {
message.error('请先选择采购会员')
message.error(getIntl().formatMessage({id: 'purchaseOrder.orderCollect.model.message2'}))
}
}
......
import { ISchema } from "@formily/antd";
import { PATTERN_MAPS } from '@/constants/regExp';
import { getIntl } from "umi";
const addressSchema: ISchema = {
type: 'object',
......@@ -13,11 +14,11 @@ const addressSchema: ISchema = {
properties: {
receiverName: {
type: 'string',
title: '收货人',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.receiverName'}),
"x-rules": [
{
required: true,
message: '请输入收货人姓名'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.receiverNameMessage'}),
},
{
limitByte: true,
......@@ -30,7 +31,7 @@ const addressSchema: ISchema = {
"x-component": 'mega-layout',
"x-component-props": {
grid: true,
label: '收货地区',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.label1'}),
required: true,
columns: 4,
enableSafeWidth: false,
......@@ -42,7 +43,7 @@ const addressSchema: ISchema = {
enum: [],
required: true,
"x-component-props": {
placeholder: '-省份/直辖市-'
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.provinceCodePh'}),
},
"x-mega-props": {
span: 1
......@@ -61,7 +62,7 @@ const addressSchema: ISchema = {
enum: [],
required: true,
"x-component-props": {
placeholder: '-市-'
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.cityCodePh'}),
},
"x-mega-props": {
span: 1
......@@ -80,7 +81,7 @@ const addressSchema: ISchema = {
enum: [],
required: true,
"x-component-props": {
placeholder: '-区/县-'
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.districtCodePh'}),
},
"x-mega-props": {
span: 1
......@@ -91,7 +92,7 @@ const addressSchema: ISchema = {
enum: [],
// required: true,
"x-component-props": {
placeholder: '-街道/乡/镇-'
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.streetCodePh'}),
},
"x-mega-props": {
span: 1
......@@ -104,13 +105,13 @@ const addressSchema: ISchema = {
"x-component": 'textarea',
"x-component-props": {
rows: 3,
placeholder: '请填写详细地址、路名、门牌号等'
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.addressPh'}),
},
title: '详细地址',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.address'}),
"x-rules": [
{
required: true,
message: '请输入详细地址'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.addressMessage'}),
},
{
limitByte: true,
......@@ -120,7 +121,7 @@ const addressSchema: ISchema = {
},
postalCode: {
type: 'string',
title: '邮编',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.postalCode'}),
"x-rules": [
{
limitByte: true,
......@@ -133,7 +134,7 @@ const addressSchema: ISchema = {
"x-component": 'mega-layout',
"x-component-props": {
grid: true,
label: '手机号',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.label2'}),
columns: 6,
enableSafeWidth: false,
className: 'noMarbottom',
......@@ -152,7 +153,7 @@ const addressSchema: ISchema = {
"x-rules": [
{
required: true,
message: '请选择区号'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.areaCodeMessage'}),
}
]
},
......@@ -164,26 +165,26 @@ const addressSchema: ISchema = {
"x-rules": [
{
pattern: PATTERN_MAPS.phone,
message: '请输入正确的手机号'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.phoneMessage1'}),
},
{
required: true,
message: '请输入手机号'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.phoneMessage2'}),
}
],
"x-component-props": {
placeholder: '输入你的手机号码',
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.phonePh'}),
style: { width: '100%' }
}
}
}
},
tel: {
title: '电话号码',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.tel'}),
type: 'string'
},
isDefault: {
title: '是否默认',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.addressSchema.isDefault'}),
type: 'boolean',
"x-mega-props": {
wrapperWidth: 36
......
......@@ -4,7 +4,7 @@ import { createFormActions } from '@formily/antd'
import addressSchema from './schema'
import './index.less'
import { postSettleAccountsAgentInvoiceMessageAdd, postSettleAccountsAgentInvoiceMessageUpdate } from '@/services/SettleV2Api'
import { getIntl } from 'umi'
export interface InvoiceModalProps {
mode: 'add' | 'edit' | 'preview' | 'default' | 'delete',
currentRef?: any,
......@@ -15,9 +15,9 @@ export interface InvoiceModalProps {
const schemaActions = createFormActions()
const modelTitle = {
'add': '新增发票',
'edit': "编辑发票",
'preview': '查看发票'
'add': getIntl().formatMessage({id: 'purchaseOrder.add'}),
'edit': getIntl().formatMessage({id: 'purchaseOrder.edit'}),
'preview': getIntl().formatMessage({id: 'purchaseOrder.view'})
}
const InvoiceModal:React.FC<InvoiceModalProps> = (props) => {
......
import { ISchema } from "@formily/antd";
import { PATTERN_MAPS } from '@/constants/regExp';
import { getIntl } from "umi";
const addressSchema: ISchema = {
type: 'object',
......@@ -17,14 +18,14 @@ const addressSchema: ISchema = {
type: {
type: 'radio',
required: true,
title: '开具类型',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.type'}),
enum: [
{
label: '企业(默认)',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.type1'}),
value: 1
},
{
label: '个人',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.type2'}),
value: 2
}
],
......@@ -40,14 +41,14 @@ const addressSchema: ISchema = {
kind: {
type: 'radio',
required: true,
title: '发票种类',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.kind'}),
enum: [
{
label: '增值税普通发票(默认)',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.kind1'}),
value: 1
},
{
label: '增值税专用发票',
label: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.kind2'}),
value: 2
}
],
......@@ -56,11 +57,11 @@ const addressSchema: ISchema = {
invoiceTitle: {
type: 'string',
required: true,
title: '发票抬头',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.invoiceTitle'}),
"x-rules": [
{
required: true,
message: '请输入发票抬头'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.invoiceTitleMessage'}),
},
{
limitByte: true,
......@@ -71,11 +72,11 @@ const addressSchema: ISchema = {
taxNo: {
type: 'string',
required: true,
title: '纳税号',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.taxNo'}),
"x-rules": [
{
required: true,
message: '请输入纳税号'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.taxNoMessage'}),
},
{
limitByte: true,
......@@ -85,7 +86,7 @@ const addressSchema: ISchema = {
},
bankOfDeposit: {
type: 'string',
title: '开户行',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.bankOfDeposit'}),
"x-rules": [
{
limitByte: true,
......@@ -95,12 +96,12 @@ const addressSchema: ISchema = {
},
account: {
type: 'string',
title: '账号',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.account'}),
maxLength: 20
},
address: {
type: 'string',
title: '地址',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.address'}),
"x-rules": [
{
limitByte: true,
......@@ -110,16 +111,16 @@ const addressSchema: ISchema = {
},
tel: {
type: 'string',
title: '电话号码',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.tel'}),
"x-rules": [
{
pattern: PATTERN_MAPS.tel,
message: '请输入正确的电话号码'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.telMessage'}),
}
]
},
isDefault: {
title: '是否默认',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.invoiceSchema.isDefault'}),
type: 'boolean',
"x-mega-props": {
wrapperWidth: 36
......
import React, { useState, useRef, useContext, useEffect } from 'react'
import React, { useState, useRef, useContext } from 'react'
import { Form, Input, Select } from 'antd';
import { history } from 'umi'
import styles from "../../index.less"
import { history, useIntl } from 'umi'
export interface PayInfoCellProps {
title: React.ReactNode;
editable: boolean;
......@@ -62,6 +60,7 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
formItemProps={},
...restProps
}) => {
const intl = useIntl()
const formItemRef = useRef<any>();
const { form, childOptions, setChildOptions, originOptions } = useContext(EditableContext);
let _childOptions = null;
......@@ -81,9 +80,9 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
}
let n = Number(value);
if(isNaN(n)) {
throw new Error('请正确输入支付比例');
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.payInfoCell.validator1'}));
} else if(n < 0 || !Number.isInteger(n)) {
throw new Error('支付比例为大于0的整数');
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.payInfoCell.validator2'}));
} else {
callback()
}
......@@ -156,7 +155,7 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
rules={[
{
required: true,
message: `${title}必须填写`,
message: intl.formatMessage({id: 'purchaseOrder.orderCollect.payInfoCell.validator3'}).replaceAll('x', `${title}`),
},
// 支付比例大于0
{
......
......@@ -14,6 +14,7 @@ import { searchBrandOptionEffect, searchCustomerCategoryOptionEffect } from '../
import CustomCategorySearch from '@/components/NiceForm/components/CustomCategorySearch'
import CustomInputSearch from '@/components/NiceForm/components/CustomInputSearch'
import { getLogisticsShipperAddressGet } from '@/services/LogisticsV2Api'
import { getIntl } from 'umi'
export interface ProductModalTableProps extends ModalTableProps {
type?: 'radio' | 'checkbox',
......@@ -25,37 +26,37 @@ export interface ProductModalTableProps extends ModalTableProps {
export const productColumns: any[] = [
{
title: '商品ID',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.productModalTable.id'}),
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '商品名称',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.productModalTable.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '品类',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.productModalTable.customerCategoryName'}),
dataIndex: 'customerCategoryName',
align: 'center',
key: 'customerCategoryName',
},
{
title: '品牌',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.productModalTable.brandName'}),
dataIndex: 'brandName',
align: 'center',
key: 'brandName',
},
{
title: '单位',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.productModalTable.unitName'}),
dataIndex: 'unitName',
align: 'center',
key: 'unitName'
},
{
title: '库存数量',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.productModalTable.stockCount'}),
dataIndex: 'stockCount',
align: 'center',
key: 'stockCount'
......@@ -153,7 +154,7 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
return (
<ModalTable
modalTitle='选择订单商品'
modalTitle={getIntl().formatMessage({id: 'purchaseOrder.orderCollect.productModalTable.title'})}
width={900}
columns={productColumns}
visible={visible}
......
import React, { useState, useRef, useContext, useEffect } from 'react'
import { Form, Input, Select } from 'antd';
import { has } from 'lodash';
import React, { useRef, useContext } from 'react'
import { Form, Input } from 'antd';
import { useIntl } from 'umi';
export interface ProductTableCellProps {
title: React.ReactNode;
......@@ -47,7 +47,8 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
}) => {
const formItemRef = useRef<any>();
const { form } = useContext(EditableContext);
const save = async e => {
const intl = useIntl()
const save = async () => {
try {
const values = await form.validateFields();
values.purchaseCount = Number(values.purchaseCount) || 0
......@@ -61,15 +62,6 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
switch(type) {
case 'input': {
// 用于判断是否是合并下单
let hasSelectMergeBtn = document.getElementsByClassName("selectMerge")
// 用于合并订单采购数量回显
if(hasSelectMergeBtn.length) {
let keyValue = {}
keyValue[dataIndex] = v
form.setFieldsValue(keyValue)
}
return <Input
style={{width: 140}}
type='number'
......@@ -88,10 +80,10 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
try {
let _value = Number(value)
if(isNaN(_value) || _value < Number(record["minOrder"])) {
throw new Error(`数量不小于最小起订数${record["minOrder"]}`)
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator3'}).replaceAll('x', record["minOrder"]))
}
if(_value > Number.MAX_SAFE_INTEGER) {
throw new Error('数值精度溢出')
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator1'}))
}
callback()
} catch (err) {
......@@ -109,11 +101,11 @@ export const ProductTableCell:React.FC<ProductTableCellProps> = ({
rules={[
{
required: true,
message: `${title}必须填写`,
message: intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator4'}).replaceAll('x', `${title}`),
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '采购数量仅限三位小数',
message: intl.formatMessage({id: 'purchaseOrder.orderCollect.productTableCell.validator2'}),
},
{
validator: validatorNumber
......
......@@ -7,6 +7,7 @@ import cx from 'classnames'
import AddressModal from '../addressModal'
import { fetchOrderApi } from '../../apis'
import { getLogisticsReceiverAddressGet, postLogisticsReceiverAddressAgentDelete } from '@/services/LogisticsV2Api'
import { useIntl } from 'umi'
const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)`
.select_style_border {
......@@ -50,6 +51,7 @@ const transformDefaultData = (data: any[]) => {
}
const SelectAddress = (props: ISchemaFieldComponentProps) => {
const intl = useIntl()
const [formInitValue, setFormInitValue] = useState<any>(null)
const [mode, setMode] = useState<'add' | 'edit' | 'default'>('default')
const [state, setFieldState] = useFieldState({
......@@ -125,7 +127,7 @@ const SelectAddress = (props: ISchemaFieldComponentProps) => {
<Col>{v.receiverName}</Col>
<Col> / </Col>
<Col>{v.phone}</Col>
{v.isDefault ? <Col style={{ marginLeft: 6 }}><Tag color='default'>默认</Tag></Col> : null}
{v.isDefault ? <Col style={{ marginLeft: 6 }}><Tag color='default'>{intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.type1'})}</Tag></Col> : null}
</Row>
<div style={{ color: '#909399' }}>{v.fullAddress}</div>
</div>
......@@ -147,13 +149,13 @@ const SelectAddress = (props: ISchemaFieldComponentProps) => {
style={{width: '100%', height: '100%', borderStyle: "dashed"}}
onClick={handleAdd}
>
<p style={{width: '100%', textAlign: 'center'}}><PlusOutlined />&nbsp;新增地址</p>
<p style={{width: '100%', textAlign: 'center'}}><PlusOutlined />&nbsp;{intl.formatMessage({id: 'purchaseOrder.orderCollect.selectAddress.add'})}</p>
</div>
</Col>}
</Row></SelectStyles>
{transformData.length > 3 &&
<div onClick={toogleMore} style={{ textAlign: 'center', cursor: 'pointer', color: '#00b37a' }}>
显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
{intl.formatMessage({id: 'purchaseOrder.more'})}{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
</div>
}
<AddressModal mode={mode} formInitValue={formInitValue} currentRef={modalRef} reloadAddress={reloadAddress} ctx={form} />
......
import {history} from "umi"
import { Button, Checkbox, Modal } from 'antd'
import { ISchemaFieldComponentProps } from '@formily/antd'
import { FilePdfFilled } from '@ant-design/icons'
import { getContractSignatureAuthAuthState } from "@/services/ContractV2Api"
const SelectContract = (props: ISchemaFieldComponentProps) => {
let { form, value = {}, mutators, editable } = props
const popConfirm = () => {
history.push(`/memberCenter/tranactionAbility/electronicContracts/apply`)
}
const onChange = (e) => {
if(e.target.checked) {
getContractSignatureAuthAuthState().then(({data}) => {
if(data.state !== 1) {
// 未认证
Modal.confirm({
title: '提示',
content: '未签约电子合同, 是否要立即前往?',
onOk: popConfirm,
maskClosable: true
})
} else {
mutators.change(1)
}
})
} else {
mutators.change(0)
}
}
return (
<div style={{display: "flex", flexDirection: "column"}}>
<Checkbox onChange={onChange}>同意</Checkbox>
<Button
type="link"
icon={<FilePdfFilled />}
style={{color: "#7178ea"}}
href={`/api/order/contractTemplate/downloadContract?contractName=${props.props["x-component-props"].contract.contractName}&contractUrl=${props.props["x-component-props"].contract.contractUrl}`}
>
{
props.props["x-component-props"].contract?.contractName
}
</Button>
</div>
)
}
SelectContract.defaultProps = {}
SelectContract.isFieldComponent = true;
export default SelectContract
......@@ -8,13 +8,14 @@ import InvoiceModal from '../invoiceModal'
import styles from './index.less'
import { PageStatus, usePageStatus } from '@/hooks/usePageStatus'
import { getSettleAccountsInvoiceMessageDetails, postSettleAccountsAgentInvoiceMessageDelete, postSettleAccountsAgentInvoiceMessageUpdate } from '@/services/SettleV2Api'
import { useIntl } from 'umi'
const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
const [formInitValue, setFormInitValue] = useState<any>(null)
const [mode, setMode] = useState<'add' | 'edit' | 'default' | 'preview' | 'delete'>('default')
const modalRef = useRef<any>({})
let { value, mutators, form, editable } = props
const intl = useIntl()
const [state, setFieldState] = useFieldState({
dataSource: [],
showMore: false,
......@@ -162,13 +163,13 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
<Radio className={styles.list_radio} value={item} key={`address_list_radio_${item?.id}`}>
<div className={styles.invoice_list_item} key={`invoice_list_item_${index}`}>
<div className={styles.invoice_list_item_content}>
<div className={cx(styles.invoice_list_item_content_tag, item.kind !== 1 ? styles.special : '')}>{item.kind === 1 ? '增值税普通发票' : '增值税专用发票'}</div>
<div className={cx(styles.invoice_list_item_content_tag, item.kind !== 1 ? styles.special : '')}>{item.kind === 1 ? intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.kind1'}) : intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.kind2'})}</div>
<div className={styles.invoice_list_item_content_name}>
<span>{item.invoiceTitle}</span>
<span>({item.type === 1 ? '企业' : '个人'})</span>
<span>({item.type === 1 ? intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.type1'}) : intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.type2'})})</span>
{
item.isDefault === 1 ? <div className={styles.default}>默认</div> :
<div className={styles.set_default} onClick={e => handleSetDefault(item, e)}>设为默认</div>
item.isDefault === 1 ? <div className={styles.default}>{intl.formatMessage({id: 'purchaseOrder.default'})}</div> :
<div className={styles.set_default} onClick={e => handleSetDefault(item, e)}>{intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.default2'})}</div>
}
</div>
</div>
......@@ -176,12 +177,12 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
useValue?.id === item?.id && (
editable ?
<div className={styles.invoice_list_item_btn_group}>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleEdit(item, e)}>编辑</div>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleDelete(item?.id, e)}>删除</div>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleEdit(item, e)}>{intl.formatMessage({id: 'purchaseOrder.edit'})}</div>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleDelete(item?.id, e)}>{intl.formatMessage({id: 'purchaseOrder.delete'})}</div>
</div>
:
<div className={styles.invoice_list_item_btn_group}>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleEdit(item, e, 'preview')}>查看</div>
<div className={styles.invoice_list_item_btn} onClick={(e) => handleEdit(item, e, 'preview')}>{intl.formatMessage({id: 'purchaseOrder.view'})}</div>
</div>
)
}
......@@ -195,7 +196,7 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
style={{width: '100%', height: '100%', borderStyle: "dashed"}}
onClick={handleAdd}
>
<p style={{width: '100%', textAlign: 'center', fontSize: 12, marginTop: 14}}><PlusOutlined />&nbsp;新增发票</p>
<p style={{width: '100%', textAlign: 'center', fontSize: 12, marginTop: 14}}><PlusOutlined />&nbsp;{intl.formatMessage({id: 'purchaseOrder.orderCollect.theInvoiceList.add'})}</p>
</div>
</Col> }
</Row>
......@@ -203,7 +204,7 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
</Radio.Group>
{ transformData.length > 3 &&
<div onClick={toogleMore} style={{textAlign: 'center', cursor: 'pointer', color: '#00b37a'}}>
显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined/>}
{intl.formatMessage({id: 'purchaseOrder.more'})}{showMore ? <CaretDownOutlined /> : <CaretUpOutlined/>}
</div>
}
......
import React from 'react'
import { formatTimeString } from '@/utils'
import { Row } from 'antd'
import { AddressPop } from '@/pages/transaction/components/addressPop'
import { getIntl } from 'umi'
// 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。
......@@ -117,83 +117,49 @@ export const memberColumns: any[] = [
key: 'memberId',
},
{
title: '会员名称',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.name'}),
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '公司类型',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.memberTypeName'}),
dataIndex: 'memberTypeName',
align: 'center',
key: 'memberTypeName',
},
{
title: '公司角色',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.roleName'}),
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '公司等级',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.levelTag'}),
dataIndex: 'levelTag',
align: 'center',
key: 'levelTag',
},
]
export const inquiryColumns: any[] = [
{
title: '报价单号',
dataIndex: 'quotationNo',
align: 'center',
key: 'quotationNo',
},
{
title: '询价单号',
dataIndex: 'inquiryListNo',
align: 'center',
key: 'inquiryListNo',
},
{
title: '报价单摘要',
dataIndex: 'details',
align: 'center',
key: 'details',
},
{
title: '报价会员',
dataIndex: 'offerMemberName',
align: 'center',
key: 'offerMemberName',
},
{
title: '单据时间',
dataIndex: 'voucherTime',
align: 'center',
key: 'voucherTime',
render: _ => formatTimeString(_)
}
]
export const paymentInformationColumns: any[] = [
{
title: '支付次数',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.batchNo'}),
dataIndex: 'batchNo',
key: 'batchNo'
},
{
title: '支付环节',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.payNode'}),
dataIndex: 'payNode',
key: 'payNode'
},
{
title: '外部状态',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.outerStatusName'}),
dataIndex: 'outerStatusName',
key: 'outerStatusName',
},
{
title: '支付比例',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.payRate'}),
dataIndex: 'payRate',
key: 'payRate',
editable: true,
......@@ -207,12 +173,12 @@ export const paymentInformationColumns: any[] = [
render: text => text + '%'
},
{
title: '支付金额',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.payPrice'}),
dataIndex: 'payPrice',
key: 'payPrice'
},
{
title: '支付方式',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.payType'}),
dataIndex: 'payType',
key: 'payType',
formItem: 'select',
......@@ -224,7 +190,7 @@ export const paymentInformationColumns: any[] = [
width: 200
},
{
title: '支付渠道',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.payChannel'}),
dataIndex: 'payChannel',
key: 'payChannel',
formItem: 'select',
......@@ -243,37 +209,37 @@ export const productInfoColumns: any[] = [
key: 'id',
},
{
title: '商品名称',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.productName'}),
dataIndex: 'productName',
align: 'center',
key: 'productName',
},
{
title: '品类',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.category'}),
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.brand'}),
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.unit'}),
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
{
title: '单价(元)',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.unitPrice'}),
dataIndex: 'unitPrice',
align: 'left',
key: 'unitPrice',
},
{
title: '会员折扣',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.memberPrice'}),
dataIndex: 'memberPrice',
key: 'memberPrice',
render: (text, record) => record.isMemberPrice && text ? text * 100 + '%' : null
......@@ -285,7 +251,7 @@ export const productInfoColumns: any[] = [
// key: 'stockCount',
// },
{
title: '采购数量',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.purchaseCount'}),
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
......@@ -294,42 +260,42 @@ export const productInfoColumns: any[] = [
width: 140
},
{
title: '含税',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.taxInclusive'}),
dataIndex: 'taxInclusive',
align: 'center',
key: 'taxInclusive',
render: (t, r) => r.taxRate ? '是' : '否'
render: (t, r) => r.taxRate ? getIntl().formatMessage({id: 'purchaseOrder.yes'}) : getIntl().formatMessage({id: 'purchaseOrder.no'}),
},
{
title: '税率',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.taxRate'}),
dataIndex: 'taxRate',
align: 'center',
key: 'taxRate',
render: (t, r) => t ? `${t}%` : null
},
{
title: '金额',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.money'}),
dataIndex: 'money',
align: 'center',
key: 'money',
},
// 接口调用
{
title: '配送方式',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.deliveryType'}),
dataIndex: 'deliveryType',
align: 'center',
key: 'deliveryType',
render: (t, r) => {
if(t === 1)
return "物流(默认)"
return getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.deliveryType1'})
else if(t === 2)
return <AddressPop pickInfo={r.logistics.render}>自提</AddressPop>
return <AddressPop pickInfo={r.logistics.render}>{getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.deliveryType2'})}</AddressPop>
else if(t === 3)
return "无需配送"
return getIntl().formatMessage({id: 'purchaseOrder.orderCollect.constant.deliveryType3'})
}
},
{
title: '操作',
title: getIntl().formatMessage({id: 'purchaseOrder.operation'}),
dataIndex: 'ctl',
align: 'center',
key: 'ctl',
......
import React, { useRef, useState, useEffect, useMemo } from 'react'
import { history } from 'umi'
import { history, useIntl } from 'umi'
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'
import { Button, Row, Col, message, Spin } from 'antd'
import { createFormActions, registerVirtualBox, useFormSpy } from '@formily/antd'
......@@ -11,7 +11,6 @@ import { procurementProcessField, procurementRenderField, procurmentRenderInit }
import ProductModalTable from './components/productModalTable'
import CirculationRecord from '../components/circulationRecord'
import SelectAddress from './components/selectAddress'
import SelectContract from './components/selectContract'
import TheInvoiceList from './components/theInvoiceList'
import { usePaymentInfo } from './model/usePaymentInfo'
import { useProductTable } from './model/useProductTable'
......@@ -30,7 +29,7 @@ import FormDetailWrapper from '@/components/FormDetailWrapper'
import { useFormDetail } from '@/formSchema/effects/useFormDetail'
import moment from 'moment'
import { getLogisticsReceiverAddressGet, getLogisticsSelectListMemberShipperAddress, postLogisticsFreightTemplateCalFreightPrice } from '@/services/LogisticsV2Api'
import { getOrderBuyerCreateDetail, postOrderBuyerValidateSubmitBatch, postOrderVendorCreateAgentOrder } from '@/services/OrderNewV2Api'
import { getOrderBuyerCreateDetail, postOrderVendorCreateAgentOrder } from '@/services/OrderNewV2Api'
export interface AgentOrderDetailProps {}
......@@ -60,6 +59,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', () => {
const sum = data.reduce((prev, next) => (prev*100 + (next.money || 0)*100)/100, 0)
const [freePrice, setFreePrice] = useState<number>(0)
const { pageStatus } = usePageStatus()
const intl = useIntl()
useEffect(() => {
if (sum + freePrice) {
......@@ -102,15 +102,15 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', () => {
return <RowStyle>
<Col span={2}>
<div>合计金额</div>
<div>{intl.formatMessage({id: 'purchaseOrder.orderCollect.title1'})}</div>
<div>{`¥${sum.toFixed(2)}`}</div>
</Col>
<Col span={2}>
<div>运费</div>
<div>{intl.formatMessage({id: 'purchaseOrder.orderCollect.title2'})}</div>
<div>{`¥${freePrice.toFixed(2)}`}</div>
</Col>
<Col span={2}>
<div>总计金额</div>
<div>{intl.formatMessage({id: 'purchaseOrder.orderCollect.title3'})}</div>
<div>{`¥${(sum + freePrice).toFixed(2)}`}</div>
</Col>
</RowStyle>
......@@ -119,6 +119,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', () => {
/** 销售订单 代理下单 */
const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
const shopDataRef = useRef<any>({})
const intl = useIntl()
const { company, memberId, memberRoleId } = getAuth() || {}
const [formLoading, setFormLoading] = useState(false)
const [btnLoading, setBtnLoading] = useState(false)
......@@ -182,7 +183,7 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
delete params.product
console.log(value, 'value')
if(formContext.innerFormErrors) {
throw new Error('请完善订单商品数据')
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.error1'}))
}
// 校验是否选择支付渠道/支付比例
if(params.payments?.length) {
......@@ -194,7 +195,7 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
}
})
if(!judgementByPay || judgementByPay.includes(false)){
throw new Error('请选择支付方式或支付渠道')
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.error2'}))
}
const totalRatio = params.payments.reduce((a, b) => a + Number(b.payRate || 0), 0)
const judgementByRatio = params.payments?.length && params.payments.map(item => {
......@@ -205,7 +206,7 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
}
})
if(!judgementByRatio || judgementByRatio.includes(false)){
throw new Error('请正确填写支付比例')
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.error3'}))
}
}
......@@ -218,12 +219,12 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
}
})
if(!judgementByCount || judgementByCount.includes(false)){
throw new Error('请填写商品采购数量')
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.error4'}))
}
// 使用发票即校验发票id
if(params.hasInvoice && !params.theInvoiceId) {
throw new Error('请新增或选择需要使用的发票')
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.error5'}))
}
setBtnLoading(true)
......@@ -324,10 +325,10 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
}
// @todo 未实现金额合计
const couponAddButton = <Button onClick={() => productRef.current.setVisible(true)} block type='default' style={{margin: '24px auto'}}>选择优惠券</Button>
const couponAddButton = <Button onClick={() => productRef.current.setVisible(true)} block type='default' style={{margin: '24px auto'}}>{intl.formatMessage({id: 'purchaseOrder.orderCollect.button2'})}</Button>
// 新增收货地址
const addNewAddress = <Button block icon={<PlusOutlined/>}>新增收货地址</Button>
const addNewAddress = <Button block icon={<PlusOutlined/>}>{intl.formatMessage({id: 'purchaseOrder.orderCollect.button3'})}</Button>
const paymentEditColumns = paymentColumns.map((col) => {
if (!col.editable) {
......@@ -389,11 +390,11 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
return (<div style={{margin: -24}}>
<FormDetailContext.Provider value={providerValue}>
<FormDetailHeader
title={id?"编辑":"新增"}
title={id?intl.formatMessage({id: 'purchaseOrder.edit'}):intl.formatMessage({id: 'purchaseOrder.add'})}
schema={initFormSchema}
extraRight={[
<Button key="1" onClick={() => addSchemaAction.submit()} loading={btnLoading} type="primary" icon={<SaveOutlined />}>
保存
{intl.formatMessage({id: 'purchaseOrder.save'})}
</Button>,
]}
/>
......@@ -408,7 +409,6 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
components={{
SelectAddress,
TheInvoiceList,
SelectContract
}}
effects={($, ctx) => {
useAsyncSelect('shopId', fetchShopLists, ['name', 'id'])
......
......@@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react'
import { OrderModalType } from '@/constants/order'
import { useLocation, history } from 'umi'
import { ISchemaFormActions } from '@formily/antd'
import { useLinkageUtils } from '@/utils/formEffectUtils'
interface DetailOrderLocationState {
// 进货单商品列表
......@@ -15,22 +14,9 @@ interface DetailOptionsProps {
addSchemaAction: ISchemaFormActions
}
const mockDefaultValue: DetailOrderLocationState = {
productList: [
{
id: 1,
name: '甲商品',
customerCategoryName: '假品类',
brandName: '假品牌'
}
],
modelType: 5
}
export const useDetailOrder = (options: DetailOptionsProps) => {
const { addSchemaAction } = options
const formilyUtils = useLinkageUtils()
// const [productDataSource, setProductDataSource] = useState
const locationState = useLocation<DetailOrderLocationState>().state || {}
const { productList } = locationState
const { modelType } = history.location.query
......
import React, { useRef, useState } from 'react'
import { useRef, useState } from 'react'
import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
import { Button, message } from 'antd';
import { PriceComp, productInfoColumns } from '../constant';
import ProductTableCell, { ProductEditableRow } from '../components/productTableCell';
import { useModalTable } from './useModalTable';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { OrderModalType } from '@/constants/order';
import { useIntl } from 'umi';
const { pageStatus } = usePageStatus()
let orderMode = null;
// 对象按key排序(运用于商城传过来的阶梯价格排序)
export const sortByKey = (params) => {
......@@ -71,9 +70,7 @@ export const getUnitPriceTotal = (record) => {
export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
const productRef = useRef<any>({})
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type: 'checkbox'})
orderMode = ctx.getFieldValue('orderMode')
const intl = useIntl()
const handleDelete = (record) => {
const newData = [...ctx.getFieldValue('products')]
// 删除formvalue
......@@ -94,23 +91,15 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
const [productColumns, setProductColumns] = useState(() => {
if (pageStatus === PageStatus.ADD) {
// 渲染操作
productInfoColumns[productInfoColumns.length - 1].render = (text, record) => <Button type='link' onClick={() => handleDelete(record)}>删除</Button>
productInfoColumns[productInfoColumns.length - 1].render = (text, record) => <Button type='link' onClick={() => handleDelete(record)}>{intl.formatMessage({id: 'purchaseOrder.delete'})}</Button>
// 渲染单价
productInfoColumns[5].render = (t, r) => {
// if(orderMode === OrderModalType["HAND_ORDER"]) {
// return <PriceComp priceSection={r.unitPrice}/>
// } else {
return r.price ? <span style={{color: 'red'}}>{r.price}</span> : <PriceComp priceSection={r.unitPrice}/>
// }
}
// 渲染商品ID
productInfoColumns[0].render = (t, r) => {
// if(orderMode === OrderModalType["HAND_ORDER"]) {
return r.id
// } else {
// return r.productId || r.id
// }
}
} else {
......@@ -130,11 +119,11 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
if (supplyMembersId) {
productRef.current.setVisible(true)
} else {
message.error('请先选择供应会员')
message.error(intl.formatMessage({id: 'purchaseOrder.orderCollect.model.message'}))
}
}
const productAddButton = <Button onClick={handleShowProduct} block type='default' style={{margin: '24px auto'}}>选择订单商品</Button>
const productAddButton = <Button onClick={handleShowProduct} block type='default' style={{margin: '24px auto'}}>{intl.formatMessage({id: 'purchaseOrder.orderCollect.model.button1'})}</Button>
const productComponents = {
body: {
row: ProductEditableRow,
......
import { FastForwardFilled } from '@ant-design/icons';
import { ISchema } from '@formily/antd';
import { getIntl } from 'umi';
import styles from '../index.less'
// 基本信息
......@@ -8,7 +8,7 @@ const basicInfo: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '基本信息',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.title1'}),
id: 'basicInfo'
},
properties: {
......@@ -27,7 +27,7 @@ const basicInfo: ISchema = {
properties: {
orderModeName: {
type: 'string',
title: '下单模式',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.orderMode'}),
"x-component": 'text',
},
orderMode: {
......@@ -39,16 +39,16 @@ const basicInfo: ISchema = {
shopId: {
type: 'number',
enum: [],
title: '适应商城',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.shopId'}),
required: true,
},
digest: {
type: 'string',
title: '订单摘要',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.digest'}),
"x-rules": [
{
required: true,
message: '请输入订单摘要'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.digestMessage'}),
},
{
limitByte: true,
......@@ -58,10 +58,10 @@ const basicInfo: ISchema = {
},
buyerMemberMajorId : {
type: 'string',
title: '采购会员',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.buyerMemberMajorId'}),
enum: [],
"x-component-props": {
placeholder: "请输入搜索采购会员",
placeholder: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.buyerMemberMajorIdPh'}),
showSearch: true,
showArrow: true,
allowClear: true,
......@@ -85,7 +85,7 @@ const basicInfo: ISchema = {
},
vendorMemberName: {
type: 'string',
title: '供应会员',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.vendorMemberName'}),
"x-component-props": {
disabled: true,
},
......@@ -116,7 +116,7 @@ const basicInfo: ISchema = {
},
type: {
type: 'string',
title: '订单类型',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.type'}),
"x-component": 'text',
},
createTime: {
......@@ -156,7 +156,7 @@ export const orderProduct: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '订单商品',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.title2'}),
id: 'orderProducts'
},
properties: {
......@@ -184,7 +184,7 @@ export const payInfo: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '支付信息',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.title3'}),
id: 'payInfo'
},
properties: {
......@@ -206,7 +206,7 @@ const submitInfo: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '送货信息',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.title4'}),
id: 'deliveryInfo'
},
properties: {
......@@ -230,7 +230,7 @@ const submitInfo: ISchema = {
deliverDate: {
type: 'string',
"x-component": 'date',
title: '送货时间',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.deliverDate'}),
required: true,
"x-component-props": {
style: { width: 400 }
......@@ -273,10 +273,10 @@ const submitInfo: ISchema = {
"x-rules": [
{
required: true,
message: '请选择送货地址'
message: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.deliveryAddresIdMessage'}),
}
],
title: '送货地址'
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.deliveryAddresId'}),
}
}
},
......@@ -291,7 +291,7 @@ const invoiceInfo: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '发票信息',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.title5'}),
id: 'invoiceInfo'
},
properties: {
......@@ -312,12 +312,12 @@ const invoiceInfo: ISchema = {
type: 'boolean',
"x-component": 'CheckboxSingle',
"x-component-props": {
children: '需要发票',
children: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.hasInvoiceChildren'}),
style: {
marginTop: 4,
}
},
title: '发票',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.hasInvoice'}),
default: false,
"x-linkages": [
{
......@@ -356,7 +356,7 @@ const otherInfo: ISchema = {
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '其他信息',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.title6'}),
id: 'otherInfo'
},
properties: {
......@@ -379,7 +379,7 @@ const otherInfo: ISchema = {
"x-component-props": {
rows: 1
},
title: '包装要求',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.pack'}),
"x-rules": [
{
limitByte: true,
......@@ -393,7 +393,7 @@ const otherInfo: ISchema = {
"x-component-props": {
rows: 1
},
title: '其他要求',
title: getIntl().formatMessage({id: 'purchaseOrder.orderCollect.schema.remark'}),
"x-rules": [
{
limitByte: true,
......
import { ISchema } from '@formily/antd';
export const memberSchema: ISchema = {
type: 'object',
properties: {
name: {
type: 'string',
"x-component": 'Search',
"x-component-props": {
placeholder: '请输入会员名称'
}
}
}
}
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