Commit 1d55dffe authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 代客下单样式变更

parent 9ef24f6f
......@@ -1125,7 +1125,7 @@ export const requisitionSchema: ISchema = {
}
},
},
"[startTime, endTime]": {
"[startDate, endDate]": {
type: 'daterange',
'x-component-props': {
placeholder: ['预交开始时间','预交结束时间'],
......
import { getPurchaseOrderSelectOption, getSaleOrderSelectOption } from './../../effect/index';
import { FORM_FILTER_PATH } from '@/formSchema/const'
export const orderTypeLabel = ['',
'询价采购',
'需求采购',
'现货采购',
'集采',
'渠道直采',
'渠道现货',
'积分兑换',
'渠道积分兑换',
'采购询价合同下单',
'采购招标合同下单',
'采购竞价合同下单',
]
/**
* 销售订单状态枚举
*/
export enum SALE_ORDER_STATUS {
PREVIEW_ORDER = -1,
READY_APPROVED_ORDER,
ONE_LEVEL_APPROVED_ORDER,
TWO_LEVEL_APPROVED_ORDER,
CONFIRM_ORDER,
CONFIRM_PAY_RESULT_ORDER,
ADD_SALE_ORDER,
ADD_LOG_ORDER,
CONFIRM_DELIVE_GOODS_ORDER,
CONFIRM_RETURN_ORDER,
RETURN_DOCUMENT_ORDER
}
/**
* 采购订单高级筛选 公用
*/
......@@ -156,7 +124,7 @@ export const tableListSchema: any = () => {
/**
* 销售订单高级筛选 公用
* 销售订单高级筛选 销售订单查询
*/
export const saleTableListSchema: any = () => {
......@@ -183,6 +151,13 @@ export const tableListSchema: any = () => {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
orderNo: {
type: 'string',
"x-component": 'Search',
......
......@@ -137,38 +137,6 @@ export const orderTypeLabelMap = {
'14': '采购招标合同',
}
// 支付方式
export const payTypeLabel = [
{
label: '线上支付',
value: 1
},
{
label: '线下支付',
value: 2
},
{
label: '授信支付',
value: 3
},
{
label: '货到付款',
value: 4
},
{
label: '账期',
value: 5
},
{
label: '月结',
value: 6
},
{
label: '合同内清算',
value: 7
},
]
export const memberColumns: any[] = [
{
title: '会员ID',
......
......@@ -188,6 +188,7 @@ export const orderProduct: ISchema = {
products: {
type: 'array',
"x-component": 'MultTable',
required: true,
"x-component-props": {
rowKey: 'id',
columns: "{{productColumns}}",
......
import React from 'react'
import { formatTimeString } from '@/utils'
import { Row } from 'antd'
import { OrderModalType } from '@/constants/order'
import { AddressPop } from '@/pages/transaction/components/addressPop'
// 简单控制价格区间的组件
......@@ -119,69 +118,6 @@ export const procurementProcessField = (value) => {
}
/***********控制订单模式联动其他字段的数组集合 *******/
export const orderCombination = {
// 是否显示报价单字段
showQuotationField: [
OrderModalType.INQUIRY_QUOTATION_ORDER,
],
// 是否显示报价单按钮
showQuotationSelectBtn: [
OrderModalType.INQUIRY_QUOTATION_ORDER,
],
// 是否显示采购合同字段
showPurchaseContractField: [
OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER,
OrderModalType.PURCHASE_TENDER_CONTRACT_ORDER,
OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER
],
// 是否显示选择采购合同按钮
showPurchaseContractBtn: [
OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER,
OrderModalType.PURCHASE_TENDER_CONTRACT_ORDER,
OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER
],
}
export const orderTypeLabelMap = {
'3': '询价采购',
'12': '采购询价合同',
'13': '采购竞价合同',
'14': '采购招标合同',
}
// 支付方式
export const payTypeLabel = [
{
label: '线上支付',
value: 1
},
{
label: '线下支付',
value: 2
},
{
label: '授信支付',
value: 3
},
{
label: '货到付款',
value: 4
},
{
label: '账期',
value: 5
},
{
label: '月结',
value: 6
},
{
label: '合同内清算',
value: 7
},
]
export const memberColumns: any[] = [
{
title: '会员ID',
......
......@@ -7,7 +7,7 @@ import { SaveOutlined, PlusOutlined, LinkOutlined } from '@ant-design/icons'
import NiceForm from '@/components/NiceForm'
import { mergeAllSchemas } from './schema'
import { useEditHideField, useOrderDeliverTimeEffect, useOrderFormInitEffect, useProductTableChangeForPay } from './effects'
import { orderCombination, procurementProcessField, procurementRenderField, procurmentRenderInit } from './constant'
import { procurementProcessField, procurementRenderField, procurmentRenderInit } from './constant'
import ProductModalTable from './components/productModalTable'
import CirculationRecord from '../components/circulationRecord'
import SelectAddress from './components/selectAddress'
......@@ -458,7 +458,6 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = () => {
productAddButton,
productComponents,
couponAddButton,
orderCombination,
addNewAddress,
CirculationRecord: <CirculationRecord/>,
help,
......
......@@ -130,6 +130,7 @@ const basicInfo: ISchema = {
}
}
// 订单商品
export const orderProduct: ISchema = {
"x-index": 2,
......@@ -143,6 +144,7 @@ export const orderProduct: ISchema = {
products: {
type: 'array',
"x-component": 'MultTable',
required: true,
"x-component-props": {
rowKey: 'id',
columns: "{{productColumns}}",
......
......@@ -19,7 +19,6 @@ const RequisitionModalTable:React.FC<RequisitionModalTableProps> = (props) => {
const { type = 'radio', schemaAction, confirmModal, currentRef, ...restProps } = props
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type})
useEffect(() => {
if (currentRef) {
currentRef.current = {
......
......@@ -46,7 +46,7 @@ export const procurmentRenderInit = (initValue: any) => {
}
}
/** 修改采购合同下单 回显商品字段转换 */
/** 修改请购单下单 回显商品字段转换 */
export const procurementRenderField = (data) => {
const _orderProductRequests = data.product.products
return _orderProductRequests.map(item => {
......@@ -71,29 +71,7 @@ export const procurementProcessField = (value) => {
return value
}
/***********控制订单模式联动其他字段的数组集合 *******/
export const orderCombination = {
// 是否显示报价单字段
showQuotationField: [
OrderModalType.INQUIRY_QUOTATION_ORDER,
],
// 是否显示报价单按钮
showQuotationSelectBtn: [
OrderModalType.INQUIRY_QUOTATION_ORDER,
],
// 是否显示采购合同字段
showPurchaseContractField: [
OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER,
OrderModalType.PURCHASE_TENDER_CONTRACT_ORDER,
OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER
],
// 是否显示选择采购合同按钮
showPurchaseContractBtn: [
OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER,
OrderModalType.PURCHASE_TENDER_CONTRACT_ORDER,
OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER
],
}
export const orderTypeLabelMap = {
......@@ -103,38 +81,6 @@ export const orderTypeLabelMap = {
'14': '采购招标合同',
}
// 支付方式
export const payTypeLabel = [
{
label: '线上支付',
value: 1
},
{
label: '线下支付',
value: 2
},
{
label: '授信支付',
value: 3
},
{
label: '货到付款',
value: 4
},
{
label: '账期',
value: 5
},
{
label: '月结',
value: 6
},
{
label: '合同内清算',
value: 7
},
]
export const memberColumns: any[] = [
{
title: '会员ID',
......
......@@ -7,7 +7,7 @@ import { SaveOutlined, LinkOutlined, PlusOutlined } from '@ant-design/icons'
import NiceForm from '@/components/NiceForm'
import { orderAddSchema } from './schema'
import { useModelTypeChange, useEditHideField, useOrderFormInitEffect, useProductTableChangeForPay } from './effects'
import { orderCombination, orderTypeLabelMap, procurementProcessField, procurementRenderField, procurmentRenderInit } from './constant'
import { orderTypeLabelMap, procurementProcessField, procurementRenderField, procurmentRenderInit } from './constant'
import CirculationRecord from '../components/circulationRecord'
import SelectAddress from './components/selectAddress'
import TheInvoiceList from './components/theInvoiceList'
......@@ -354,7 +354,6 @@ const AddRequisitionOrder:React.FC<AddRequisitionOrderProps> = (props) => {
materialColumns,
materialAddButton,
materialComponents,
orderCombination,
addNewAddress,
CirculationRecord: <CirculationRecord/>,
help,
......
......@@ -60,13 +60,13 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
return tempColumn
})
const handleShowMaterial = () => {
const supplyMembersId = ctx.getFieldValue('vendorMemberId')
const requisitionId = ctx.getFieldValue('requisitionId')
const products = ctx.getFieldValue('products')
if (supplyMembersId) {
if (requisitionId) {
materialRef.current.setVisible(true)
materialRef.current.rowSelectionCtl.setSelectedRowKeys(() => products.map(item => item.productId))
} else {
message.error('请先选择采购询价合同')
message.error('请先选择请购单')
}
}
......
......@@ -122,37 +122,6 @@ export const orderTypeLabelMap = {
'14': '采购招标合同',
}
// 支付方式
export const payTypeLabel = [
{
label: '线上支付',
value: 1
},
{
label: '线下支付',
value: 2
},
{
label: '授信支付',
value: 3
},
{
label: '货到付款',
value: 4
},
{
label: '账期',
value: 5
},
{
label: '月结',
value: 6
},
{
label: '合同内清算',
value: 7
},
]
export const memberColumns: any[] = [
{
......
......@@ -167,6 +167,7 @@ export const orderMaterial: ISchema = {
products: {
type: 'array',
"x-component": 'MultTable',
required: true,
"x-component-props": {
rowKey: 'materialId',
columns: "{{materialColumns}}",
......
import React, { useState, useRef, useEffect } from 'react'
import React, { useState, useRef } from 'react'
import styled from 'styled-components'
import { ISchemaFormProps, ISchemaFieldProps, ISchemaFieldComponentProps, createFormActions, useFieldState } from '@formily/antd'
import { ISchemaFieldComponentProps, useFieldState } from '@formily/antd'
import { Button, Space, Row, Col, Tag } from 'antd'
import { PlusOutlined, DeleteColumnOutlined, EditOutlined, DeleteOutlined, CaretUpOutlined, CaretDownOutlined, EyeOutlined } from '@ant-design/icons'
import { PlusOutlined, EditOutlined, DeleteOutlined, CaretUpOutlined, CaretDownOutlined, EyeOutlined } from '@ant-design/icons'
import cx from 'classnames'
import AddressModal from '../addressModal'
import { fetchOrderApi } from '../../apis'
......@@ -11,7 +11,7 @@ import { PublicApi } from '@/services/api'
const SelectStyles = styled((props) => <div className='select-list' {...props}></div>)`
.select_style_border {
border: 1px solid #EEF0F3;
margin-top: 20px;
// margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;
......@@ -115,11 +115,11 @@ const SelectAddress = (props: ISchemaFieldComponentProps) => {
}
return (
<div style={{ width: '100%' }}>
{editable && <Button block onClick={handleAdd} icon={<PlusOutlined />}>新建地址</Button>}
<SelectStyles>
<div style={{ width: '100%'}}>
{/* {editable && <Button block onClick={handleAdd} icon={<PlusOutlined />}>新建地址</Button>} */}
<SelectStyles><Row gutter={[16, 16]} style={{width: '100%'}}>
{
showDataSource.map(v => <div key={v.id} onClick={() => handleCheck(v)} className={cx('select_style_border', checkedId === v.id ? 'active' : '')}>
showDataSource.map(v => <Col span={12}><div key={v.id} onClick={() => handleCheck(v)} className={cx('select_style_border', checkedId === v.id ? 'active' : '')}>
<div>
<Row style={{ color: '#303133' }}>
<Col>{v.receiverName}</Col>
......@@ -139,11 +139,20 @@ const SelectAddress = (props: ISchemaFieldComponentProps) => {
<EyeOutlined onClick={(e) => handleEdit(v, e, 'preview')} />
}
</Space>
</div>)
}
</SelectStyles>
</div></Col>)
}
{editable && <Col span={12}>
<div
className='select_style_border'
style={{width: '100%', height: '100%', borderStyle: "dashed"}}
onClick={handleAdd}
>
<p style={{width: '100%', textAlign: 'center'}}><PlusOutlined />&nbsp;新增地址</p>
</div>
</Col>}
</Row></SelectStyles>
{transformData.length > 3 &&
<div onClick={toogleMore} style={{ textAlign: 'center', cursor: 'pointer' }}>
<div onClick={toogleMore} style={{ textAlign: 'center', cursor: 'pointer', color: '#00b37a' }}>
显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
</div>
}
......
......@@ -13,9 +13,9 @@
.invoice_list {
position: relative;
display: flex;
// display: flex;
margin: 0 -10px;
flex-wrap: wrap;
// flex-wrap: wrap;
.invoice_list_item {
display: flex;
......@@ -70,6 +70,18 @@
}
}
.select_style_border {
border: 1px solid #EEF0F3;
// display: flex;
// align-items: center;
// justify-content: space-between;
// padding: 8px 14px;
// flex: 1;
// cursor: pointer;
// line-height: 28px;
// position:relative;
}
:global {
span.ant-radio+* {
display: block;
......@@ -82,7 +94,7 @@
align-items: center;
height: 72px;
background-color: #FAFAFA;
margin: 10px;
// margin: 10px;
padding-left: 16px;
}
......
import React, { useState, useRef } from 'react'
import { ISchemaFieldComponentProps, useFieldState } from '@formily/antd'
import { Button, Radio } from 'antd'
import { Col, Radio, Row } from 'antd'
import { PlusOutlined, CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons'
import cx from 'classnames'
import { fetchOrderApi } from '../../apis'
......@@ -153,11 +153,12 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
return (
<div style={{width: '100%'}} className={styles.invoice}>
{ editable && <Button block onClick={handleAdd} icon={<PlusOutlined/>}>新增发票</Button> }
{/* { editable && <Button block onClick={handleAdd} icon={<PlusOutlined/>}>新增发票</Button> } */}
<Radio.Group className={styles.raido_group} value={useValue} onChange={e => handleCheck(e)}>
<div className={styles.invoice_list}>
<Row gutter={[16, 16]}>
{
showDataSource.map((item, index) => (
showDataSource.map((item, index) => (<Col span={12}>
<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}>
......@@ -186,13 +187,22 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
}
</div>
</Radio>
))
}
</Col>))
}
{ editable && <Col span={12}>
<div
className={styles.select_style_border}
style={{width: '100%', height: '100%', borderStyle: "dashed"}}
onClick={handleAdd}
>
<p style={{width: '100%', textAlign: 'center', fontSize: 12, marginTop: 14}}><PlusOutlined />&nbsp;新增发票</p>
</div>
</Col> }
</Row>
</div>
</Radio.Group>
{ transformData.length > 3 &&
<div onClick={toogleMore} style={{textAlign: 'center', cursor: 'pointer'}}>
<div onClick={toogleMore} style={{textAlign: 'center', cursor: 'pointer', color: '#00b37a'}}>
显示更多{showMore ? <CaretDownOutlined /> : <CaretUpOutlined/>}
</div>
}
......
import React from 'react'
import { formatTimeString } from '@/utils'
import { Row } from 'antd'
import { DELIVERY_TYPE, OrderModalType } from '@/constants/order'
import { AddressPop } from '@/pages/transaction/components/addressPop'
// 简单控制价格区间的组件
......@@ -110,69 +109,6 @@ export const procurementProcessField = (value) => {
}
/***********控制订单模式联动其他字段的数组集合 *******/
export const orderCombination = {
// 是否显示报价单字段
showQuotationField: [
OrderModalType.INQUIRY_QUOTATION_ORDER,
],
// 是否显示报价单按钮
showQuotationSelectBtn: [
OrderModalType.INQUIRY_QUOTATION_ORDER,
],
// 是否显示采购合同字段
showPurchaseContractField: [
OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER,
OrderModalType.PURCHASE_TENDER_CONTRACT_ORDER,
OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER
],
// 是否显示选择采购合同按钮
showPurchaseContractBtn: [
OrderModalType.PURCHASE_ENQUIRY_CONTRACT_ORDER,
OrderModalType.PURCHASE_TENDER_CONTRACT_ORDER,
OrderModalType.PURCHASE_BIDDING_CONTRACT_ORDER
],
}
export const orderTypeLabelMap = {
'3': '询价采购',
'12': '采购询价合同',
'13': '采购竞价合同',
'14': '采购招标合同',
}
// 支付方式
export const payTypeLabel = [
{
label: '线上支付',
value: 1
},
{
label: '线下支付',
value: 2
},
{
label: '授信支付',
value: 3
},
{
label: '货到付款',
value: 4
},
{
label: '账期',
value: 5
},
{
label: '月结',
value: 6
},
{
label: '合同内清算',
value: 7
},
]
export const memberColumns: any[] = [
{
title: '会员ID',
......
......@@ -9,7 +9,7 @@ import { SaveOutlined, PlusOutlined } from '@ant-design/icons'
import NiceForm from '@/components/NiceForm'
import { mergeAllSchemas } from './schema'
import { useEditHideField, useOrderDeliverTimeEffect, useOrderFormInitEffect, useProductTableChangeForPay } from './effects'
import { orderCombination, procurementProcessField, procurementRenderField, procurmentRenderInit } from './constant'
import { procurementProcessField, procurementRenderField, procurmentRenderInit } from './constant'
import ProductModalTable from './components/productModalTable'
import CirculationRecord from '../components/circulationRecord'
import SelectAddress from './components/selectAddress'
......@@ -29,6 +29,10 @@ import { fectchShopListsSource } from '@/utils/type'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
import { fetchOrderApi } from './apis'
import { debounce } from 'lodash'
import { FormDetailContext } from '@/formSchema/context'
import FormDetailHeader from '@/components/FormDetailHeader'
import FormDetailWrapper from '@/components/FormDetailWrapper'
import { useFormDetail } from '@/formSchema/effects/useFormDetail'
export interface AgentOrderDetailProps {}
......@@ -125,10 +129,9 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
const {
pageStatus,
id,
page_type = '0',
modelType,
} = usePageStatus()
const [initFormSchema, setInitFormSchema] = useState<any>(() => ({...mergeAllSchemas[page_type]}))
const [initFormSchema, setInitFormSchema] = useState<any>(() => ({...mergeAllSchemas}))
const [initFormValue, setInitFormValue] = useState<any>(() => {
let resultState = {}
if (modelType) {
......@@ -138,6 +141,9 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
}
return resultState
})
const { formContext } = useFormDetail()
const [products, setProducts] = useState<any>([])
const [paymentColumns, paymentComponents, paymentSave] = usePaymentInfo(
addSchemaAction,
......@@ -177,7 +183,9 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
const params = { ...value}
delete params.product
console.log(value, 'value')
if(formContext.innerFormErrors) {
throw new Error('请完善订单商品数据')
}
// 校验是否选择支付渠道/支付比例
if(params.payments?.length) {
const judgementByPay = params.payments?.length && params.payments.map(item => {
......@@ -353,24 +361,11 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
})
const providerValue = {
detailData: initFormValue,
// detailData: initFormValue,
schemaActions: addSchemaAction,
formContext,
}
// const handleMemberSearch = (value) => {
// if(value) {
// fetchOrderApi.getMemberConsumeLists({ name: value }).then(data => {
// addSchemaAction.setFieldState('buyerMemberId', state => {
// state.props.enum = data.map(item => ({
// ...item,
// label: `${item.name}/${item.memberTypeName}/${item.roleName}`,
// value: item.memberId,
// }))
// })
// })
// }
// }
const handleMemberSearch = useMemo(() => {
addSchemaAction.setFieldState('buyerMemberMajorId', state => {
state.props['x-component-props'].notFoundContent = <Spin size="small" />
......@@ -392,19 +387,18 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
return debounce(loadOptions, 800);
}, [800])
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回"/>}
title={changeRouterTitleByStatus()}
extra={[
return (<div style={{margin: -24}}>
<FormDetailContext.Provider value={providerValue}>
<FormDetailHeader
title={id?"编辑":"新增"}
schema={initFormSchema}
extraRight={[
<Button key="1" onClick={() => addSchemaAction.submit()} loading={btnLoading} type="primary" icon={<SaveOutlined />}>
保存
</Button>,
]}
>
<ReadyAddOrderDetailContext.Provider value={providerValue}>
<Card className={styles.orderCollectCard} style={{marginTop: 24}}>
/>
<FormDetailWrapper>
<NiceForm
loading={formLoading}
previewPlaceholder=' '
......@@ -463,6 +457,9 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
})
})
// 注入表单完成进度
formContext.useAttachmentChangeForContext(ctx)
}}
expressionScope={{
paymentColumns: paymentEditColumns,
......@@ -471,19 +468,17 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
productAddButton,
productComponents,
couponAddButton,
orderCombination,
addNewAddress,
CirculationRecord: <CirculationRecord/>,
help,
handleMemberSearch
}}
/>
</Card>
</FormDetailWrapper>
</FormDetailContext.Provider>
<ProductModalTable currentRef={productRef} schemaAction={addSchemaAction} sectionProps={sectionProps} forceRender/>
</ReadyAddOrderDetailContext.Provider>
</PageHeaderWrapper>
)
</div>)
}
AgentOrderDetail.defaultProps = {}
......
......@@ -5,10 +5,10 @@ import styles from '../index.less'
const basicInfo: ISchema = {
"x-index": 0,
type: 'object',
"x-component": 'tabpane',
"x-component": 'MellowCard',
"x-component-props": {
tab: '基本信息',
className: 'useConnectBtnWrapper'
title: '基本信息',
id: 'basicInfo'
},
properties: {
NO_SUBMIT_LAYOUT: {
......@@ -16,8 +16,12 @@ const basicInfo: ISchema = {
"x-component": 'mega-layout',
"x-component-props": {
labelCol: 4,
labelAlign: 'left',
wrapperCol: 10
wrapperCol: 18,
labelAlign: "left",
grid: true,
full: true,
autoRow: true,
columns: 2,
},
properties: {
orderModeName: {
......@@ -144,18 +148,21 @@ const basicInfo: ISchema = {
}
}
// 订单商品
export const orderProduct: ISchema = {
"x-index": 2,
type: 'object',
"x-component": 'tabpane',
"x-component": 'MellowCard',
"x-component-props": {
tab: '订单商品'
title: '订单商品',
id: 'orderProducts'
},
properties: {
products: {
type: 'array',
"x-component": 'MultTable',
required: true,
"x-component-props": {
rowKey: 'id',
columns: "{{productColumns}}",
......@@ -174,9 +181,10 @@ export const orderProduct: ISchema = {
export const payInfo: ISchema = {
"x-index": 3,
type: 'object',
"x-component": 'tabpane',
"x-component": 'MellowCard',
"x-component-props": {
tab: '支付信息',
title: '支付信息',
id: 'payInfo'
},
properties: {
payments: {
......@@ -187,35 +195,31 @@ export const payInfo: ISchema = {
columns: "{{paymentColumns}}",
components: "{{paymentComponents}}"
},
// default: [
// {
// payCount: 1,
// id: 1,
// payRatio: 123
// }
// ]
}
}
}
// 交付信息
// 送货信息
const submitInfo: ISchema = {
"x-index": 1,
type: 'object',
"x-component": 'tabpane',
"x-component": 'MellowCard',
"x-component-props": {
tab: '送货信息'
title: '送货信息',
id: 'deliveryInfo'
},
properties: {
NO_SUBMIT_LAYOUT_2: {
type: 'object',
"x-component": 'mega-layout',
'x-component-props': {
labelCol: 6,
labelAlign: 'left',
labelCol: 2,
wrapperCol: 9,
labelAlign: "left",
grid: true,
columns: 2,
// full: true
full: true,
autoRow: true,
columns: 1,
},
properties: {
FLEX_LAYOUT_LEFT: {
......@@ -228,11 +232,6 @@ const submitInfo: ISchema = {
title: '送货时间',
required: true,
"x-component-props": {
// disabledDate: current => {
// return current && current < moment().startOf('day')
// },
// showTime: true,
// format: 'YYYY-MM-DD HH:mm',
style: { width: 400 }
}
},
......@@ -248,14 +247,22 @@ const submitInfo: ISchema = {
},
}
},
FLEX_LAYOUT_RIGHT: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelCol: 2,
wrapperCol: 22,
},
properties: {
deliveryAddresId: {
type: 'string',
"x-component": 'SelectAddress',
// "x-mega-props": {
// style: {
// full: true
// }
// },
"x-mega-props": {
style: {
full: true
}
},
"x-component-props": {
dataSource: [],
times: 0,
......@@ -269,26 +276,33 @@ const submitInfo: ISchema = {
title: '送货地址'
}
}
},
}
}
}
}
// 其他信息
const ortherInfo: ISchema = {
// 发票信息
const invoiceInfo: ISchema = {
"x-index": 4,
type: 'object',
"x-component": 'tabpane',
"x-component": 'MellowCard',
"x-component-props": {
tab: '其他信息'
title: '发票信息',
id: 'invoiceInfo'
},
properties: {
NO_SUBMIT_LAYOUT_ORTHER: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelAlign: 'left',
labelCol: 4,
wrapperCol: 10
labelCol: 2,
wrapperCol: 9,
labelAlign: "left",
grid: true,
full: true,
autoRow: true,
columns: 1,
},
properties: {
hasInvoice: {
......@@ -306,10 +320,18 @@ const ortherInfo: ISchema = {
{
type: 'value:visible',
target: 'theInvoiceId',
condition: "{{!!$value}}"
condition: "{{$value}}"
}
]
},
FLEX_LAYOUT_RIGHT: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelCol: 2,
wrapperCol: 22,
},
properties: {
theInvoiceId: {
type: 'number',
title: ' ',
......@@ -318,11 +340,41 @@ const ortherInfo: ISchema = {
times: 0,
}
},
}
},
}
}
}
}
// 其他信息
const otherInfo: ISchema = {
"x-index": 5,
type: 'object',
"x-component": 'MellowCard',
"x-component-props": {
title: '其他信息',
id: 'otherInfo'
},
properties: {
NO_SUBMIT_LAYOUT_ORTHER: {
type: 'object',
"x-component": 'mega-layout',
"x-component-props": {
labelCol: 4,
wrapperCol: 18,
labelAlign: "left",
grid: true,
full: true,
autoRow: true,
columns: 2,
},
properties: {
pack: {
type: 'string',
"x-component": 'textarea',
"x-component-props": {
rows: 4
rows: 1
},
title: '包装要求',
"x-rules": [
......@@ -336,7 +388,7 @@ const ortherInfo: ISchema = {
type: 'string',
"x-component": 'textarea',
"x-component-props": {
rows: 4
rows: 1
},
title: '其他要求',
"x-rules": [
......@@ -352,91 +404,20 @@ const ortherInfo: ISchema = {
}
// 新增订单详情
export const orderDetailSchema: ISchema = {
type: 'object',
properties: {
NO_SUBMIT_TABS: {
type: 'object',
"x-component": 'tab',
properties: {
basicInfo,
submitInfo,
orderProduct,
payInfo,
ortherInfo,
}
}
}
}
// 一级审核详情
export const auditOneSchema: ISchema = {
type: 'object',
properties: {
NO_SUBMIT_TABS: {
type: 'object',
"x-component": 'tab',
properties: {
basicInfo,
submitInfo,
orderProduct,
payInfo,
ortherInfo,
}
}
}
}
// 新增时使用的schema
export const orderAddSchema: ISchema = {
type: 'object',
properties: {
NO_SUBMIT_TABS: {
type: 'object',
"x-component": 'tab',
properties: {
basicInfo,
submitInfo,
orderProduct,
payInfo,
ortherInfo,
}
}
invoiceInfo,
otherInfo,
}
}
// 确认电子合同
export const orderElectronicSchema: ISchema = {
type: 'object',
properties: {
NO_SUBMIT_TABS: {
type: 'object',
"x-component": 'tab',
properties: {
basicInfo,
submitInfo,
orderProduct,
payInfo,
ortherInfo,
}
}
}
}
// 根据传入的query参数 判断当前使用哪个schema
export const mergeAllSchemas = {
// 新增订单详情
"-1": orderDetailSchema,
0: orderAddSchema,
// 一级审核详情
1: auditOneSchema,
// 二级审核详情
2: auditOneSchema,
// 待提交订单详情
3: orderDetailSchema,
// 电子合同详情
4: orderElectronicSchema,
// 订单支付
5: orderDetailSchema
...orderAddSchema,
}
......@@ -43,7 +43,7 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
const { transformRef, orderColumns } = useTransformOrderTable(transformActions)
const { roles } = getAuth() || {}
const serversRoles = roles.filter(item => item['roleType'] === MEMBER_ROLE_TYPE_SERVICE_CONSUMER)
const { token, memberId, memberRoleId } = (getAuth() || {})
const { token } = (getAuth() || {})
const fetchParams = useRef<any>({})
const loadingTableData = (params) => {
......
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