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

fix: 对接查看收货回单

parent dcc6fe3f
......@@ -266,7 +266,8 @@ export const RelevanceGoodDrawer:React.FC<RelevanceGoodDrawerProps> = ({
schema: goodSearch,
components: {
ModalSearch: Search,
Submit, CustomInputSearch,
Submit,
CustomInputSearch,
CustomCategorySearch
},
effects: ($, actions) => {
......
......@@ -173,7 +173,7 @@ const ApproveSchema = {
},
{
limitByte: true,
maxByte: 30
maxByte: 120
}
]
}
......
import React, { useCallback, useContext, useRef, useState } from 'react'
import { Tabs, Table, Button } from 'antd'
import { Tabs, Table, Button, Modal, List } from 'antd'
import StatusColors from '@/pages/transaction/components/statusColors'
import { formatTimeString } from '@/utils'
import { OrderDetailContext } from '../../_public/order/context'
......@@ -12,6 +12,7 @@ import ModalForm from '@/components/ModalForm'
import { createFormActions } from '@formily/antd'
import { getAuth } from '@/utils/auth'
import { UPLOAD_TYPE } from '@/constants'
import OverflowText from '@/components/OverflowText'
export interface OrderDeleveRecordProps {}
......@@ -32,6 +33,8 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
const [disabled, setDisabled] = useState<boolean>(false)
const [loading, setLoading] = useState<boolean>(false)
const { token } = getAuth() || {}
const [visible, setVisible] = useState<boolean>(false)
const [transData, setTransData] = useState<string[]>([])
const { data, reloadFormData } = useContext(OrderDetailContext)
const { deliveries, deliveryDetails, orderMode, orderKind } = data
......@@ -400,10 +403,18 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
render: (text, record) => <>
{ !isPreview && isReturn && !dataRef.current.includes(record.id) && <Button type='link' disabled={disabled} onClick={() => handleReturn(record)}>确认回单</Button> }
{ !isPreview && isReceived && record.showReceive && <Button type='link' disabled={disabled} onClick={() => handleConfirm(record)}>确认收货</Button> }
{ isPreview && <Button type='link' disabled={disabled} onClick={() => handlePreviewReturn(record)}>查看收货回单</Button> }
</>
},
]
const handlePreviewReturn = (record) => {
if(record?.receiveBill) {
setTransData([record.receiveBill])
}
setVisible(true)
}
// 确认收货
const handleConfirm = async (record) => {
// const params = {
......@@ -427,8 +438,10 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
// 提交凭证
const handleSubmit = useCallback(() => {
// @todo 待对接确认收货提交收货凭证
setLoading(true)
receiveActions.submit().then(async ({values}: any) => {
values.receiveBill = values.receiveBill[0]['data']
const result = await PublicApi.postOrderBuyerValidateReceiveConfirm(values)
if (result.code === 1000) {
receiveActions.reset()
......@@ -495,6 +508,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
modalTitle='确认收货'
currentRef={receiveRef}
confirm={handleSubmit}
cancel={() => setDisabled(false)}
actions={receiveActions}
schema={{
type: 'object',
......@@ -516,7 +530,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
title: '收货批次',
visible: false,
},
url: {
receiveBill: {
title: '收货回单',
'x-component': 'Upload',
'x-component-props': {
......@@ -535,6 +549,24 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
}}
modalProps={{confirmLoading: loading}}
/>
<Modal
title="查看收货回单"
visible={visible}
onCancel={() => setVisible(false)}
footer={null}
>
<List
itemLayout="horizontal"
dataSource={transData || []}
renderItem={(item: string) => (
<List.Item style={{fontSize: 12}} extra={<a href={item} target='_blank'>预览</a>}>
<OverflowText style={{flex: '.9'}}>
{item}
</OverflowText>
</List.Item>
)}
/>
</Modal>
</>
)
}
......
import React, { useCallback, useContext, useRef, useState } from 'react'
import { Tabs, Table, Button, Space,Modal } from 'antd'
import { Tabs, Table, Button, Space,Modal, List } from 'antd'
import StatusColors from '@/pages/transaction/components/statusColors'
import { formatTimeString } from '@/utils'
import { OrderDetailContext } from '../../_public/order/context'
......@@ -10,10 +10,13 @@ import { PublicApi } from '@/services/api'
import { history } from 'umi'
import { ExclamationCircleOutlined } from '@ant-design/icons'
import { useHttpRequest } from '@/hooks/useHttpRequest'
import ModalForm from '@/components/ModalForm'
import { createFormActions } from '@formily/antd'
import OverflowText from '@/components/OverflowText'
export interface OrderSaleRecordProps {
export interface OrderSaleRecordProps {}
}
const receiveActions = createFormActions()
const { confirm } = Modal;
......@@ -26,6 +29,8 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
// 是否是确认回单页
const isReturn = pathname.indexOf('readyConfirmReturnOrder') !== -1
const [disabled, setDisabled] = useState<boolean>(false)
const [visible, setVisible] = useState<boolean>(false)
const [transData, setTransData] = useState<string[]>([])
// 用于储存已经修改过的订单id
const dataRef = useRef<any>([])
const { data, reloadFormData } = useContext(OrderDetailContext)
......@@ -401,12 +406,20 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
render: (text, record) => <>
{ !isPreview && isReturn && record.showReply && <Button type='link' disabled={disabled} onClick={() => handleReturn(record)}>确认回单</Button> }
{ !isPreview && isDeleved && record.showDelivery && <Button type='link' disabled={disabled} onClick={() => handleConfirm(record)}>确认发货</Button> }
{ isPreview && <Button type='link' disabled={disabled} onClick={() => handlePreviewReturn(record)}>查看收货回单</Button> }
</>
},
]
const { run, loading } = useHttpRequest(PublicApi.postOrderReceiptOrderConfirmedAll)
const handlePreviewReturn = (record) => {
if(record?.receiveBill) {
setTransData([record.receiveBill])
}
setVisible(true)
}
// 确认全部回单
const handleSubmit = useCallback(async () => {
const params = {
......@@ -534,6 +547,24 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
</Tabs>
</MellowCard>
}
<Modal
title="查看收货回单"
visible={visible}
onCancel={() => setVisible(false)}
footer={null}
>
<List
itemLayout="horizontal"
dataSource={transData || []}
renderItem={(item: string) => (
<List.Item style={{fontSize: 12}} extra={<a href={item} target='_blank'>预览</a>}>
<OverflowText style={{flex: '.9'}}>
{item}
</OverflowText>
</List.Item>
)}
/>
</Modal>
</>
)
}
......
import React, { useRef, useState, useEffect } from 'react'
import { history } from 'umi'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import ReutrnEle from '@/components/ReturnEle'
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'
import { Button, Card, Row, Col, message } from 'antd'
import { Button, Row, Col, message } from 'antd'
import { createFormActions, registerVirtualBox, useFormSpy } from '@formily/antd'
import { SaveOutlined, LinkOutlined, PlusOutlined } from '@ant-design/icons'
import NiceForm from '@/components/NiceForm'
......@@ -16,10 +14,7 @@ import TheInvoiceList from './components/theInvoiceList'
import styled from 'styled-components'
import { useUpdate } from '@umijs/hooks'
import { PublicApi } from '@/services/api'
import { changeRouterTitleByStatus } from '../../_public/order/utils'
import { help } from '../../common'
import { ReadyAddOrderDetailContext } from '../context'
import styles from './index.less'
import { useMaterialTable } from './model/useMaterialTable'
import ContractModalTable from './components/contractModalTable'
import MaterialModalTable from './components/materialModalTable'
......@@ -28,7 +23,6 @@ import FormDetailHeader from '@/components/FormDetailHeader'
import { FormDetailContext } from '@/formSchema/context'
import FormDetailWrapper from '@/components/FormDetailWrapper'
import { useFormDetail } from '@/formSchema/effects/useFormDetail'
import { filterProductDataById } from '../orderCollect/components/productModalTable'
import moment from 'moment'
export interface AddRequisitionOrderProps { }
......@@ -303,19 +297,6 @@ const AddRequisitionOrder:React.FC<AddRequisitionOrderProps> = (props) => {
}
return (<div style={{margin: -24}}>
{/* <PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回"/>}
title={changeRouterTitleByStatus()}
extra={[
<Button key="1" onClick={() => addSchemaAction.submit()} loading={btnLoading} type="primary" icon={<SaveOutlined />}>
保存
</Button>,
]}
>
<ReadyAddOrderDetailContext.Provider value={providerValue}>
<Card className={styles.orderCollectCard} style={{marginTop: 24}}> */}
<FormDetailContext.Provider value={providerValue}>
<FormDetailHeader
title={id?"编辑":"新增"}
......@@ -383,19 +364,15 @@ const AddRequisitionOrder:React.FC<AddRequisitionOrderProps> = (props) => {
help,
}}
/>
{/* </Card> */}
</FormDetailWrapper>
</FormDetailContext.Provider>
{/* 选择供应会员 */}
<MemberModalTable currentRef={memberRef} productRef={materialRef} schemaAction={addSchemaAction}/>
{/* 选择请购单 */}
<ContractModalTable currentRef={requisitionOrderRef} schemaAction={addSchemaAction}/>
{/* 选择采购物料 */}
<MaterialModalTable currentRef={materialRef} schemaAction={addSchemaAction} sectionProps={surplusProps} />
{/* 选择供应会员 */}
<MemberModalTable currentRef={memberRef} productRef={materialRef} schemaAction={addSchemaAction}/>
{/* 选择请购单 */}
<ContractModalTable currentRef={requisitionOrderRef} schemaAction={addSchemaAction}/>
{/* 选择采购物料 */}
<MaterialModalTable currentRef={materialRef} schemaAction={addSchemaAction} sectionProps={surplusProps} />
{/* </ReadyAddOrderDetailContext.Provider>
</PageHeaderWrapper> */}
</div>)
}
......
import { ISchema } from '@formily/antd';
import moment from 'moment'
// // 基本信息
// const basicInfo: ISchema = {
// "x-index": 0,
// type: 'object',
// "x-component": 'tabpane',
// "x-component-props": {
// tab: '基本信息',
// className: 'useConnectBtnWrapper'
// },
// properties: {
// NO_SUBMIT_LAYOUT: {
// type: 'object',
// "x-component": 'mega-layout',
// "x-component-props": {
// labelCol: 4,
// labelAlign: 'left',
// wrapperCol: 10
// },
// properties: {
// orderMode: {
// type: 'string',
// required: true,
// enum: [{
// label: '请购单下单',
// value: 10,
// }],
// title: '下单模式',
// default: 10,
// "x-component-props": {
// disabled: true,
// }
// },
// digest: {
// type: 'string',
// title: '订单摘要',
// "x-rules": [
// {
// required: true,
// message: '请输入订单摘要'
// },
// {
// limitByte: true,
// maxByte: 60
// }
// ]
// },
// requisitionNo: {
// type: 'string',
// title: '对应请购单',
// "x-component-props": {
// disabled: true,
// addonAfter: "{{orderRequisition}}"
// }
// },
// vendorMemberName: {
// type: 'string',
// title: '供应会员',
// "x-component-props": {
// disabled: true,
// addonAfter: "{{orderMember}}"
// },
// required: true,
// },
// vendorMemberId: {
// type: 'string',
// display: false
// },
// vendorRoleId: {
// type: 'string',
// display: false
// },
// idList: {
// type: 'array',
// display: false
// },
// productType: {
// type: 'number',
// display: false
// },
// orderNo: {
// type: 'string',
// title: '订单编号',
// "x-component": 'text',
// visible: false
// },
// type: {
// type: 'string',
// title: '订单类型',
// "x-component": 'text',
// default: '请购单采购'
// },
// createTime: {
// type: 'string',
// title: '下单时间',
// visible: false
// },
// interiorState: {
// type: 'string',
// title: '内部状态',
// visible: false
// },
// externalState: {
// type: 'string',
// title: '外部状态',
// visible: false
// },
// requisition: {
// type: 'object',
// title: '请购单信息',
// visible: false
// }
// }
// },
// }
// }
// // 合同下单 订单物料
// export const orderMaterial: ISchema = {
// "x-index": 2,
// type: 'object',
// "x-component": 'tabpane',
// "x-component-props": {
// tab: '订单物料'
// },
// properties: {
// products: {
// type: 'array',
// "x-component": 'MultTable',
// "x-component-props": {
// rowKey: 'materialId',
// columns: "{{materialColumns}}",
// components: "{{materialComponents}}",
// prefix: "{{materialAddButton}}",
// },
// },
// // 仅合同下单时备用参数数据
// ordeProducts: {
// type: 'array',
// title: '合同下单记录',
// visible: false
// },
// NO_SUBMIT_SPY: {
// type: 'object',
// "x-component": "moneyTotalBox"
// }
// }
// }
// // 送货信息
// const submitInfo: ISchema = {
// "x-index": 1,
// type: 'object',
// "x-component": 'tabpane',
// "x-component-props": {
// tab: '送货信息'
// },
// properties: {
// NO_SUBMIT_LAYOUT_2: {
// type: 'object',
// "x-component": 'mega-layout',
// 'x-component-props': {
// labelCol: 6,
// labelAlign: 'left',
// grid: true,
// columns: 2,
// full: true
// },
// properties: {
// FLEX_LAYOUT_LEFT: {
// type: 'object',
// "x-component": 'mega-layout',
// properties: {
// deliverDate: {
// type: 'string',
// "x-component": 'date',
// title: '送货日期',
// required: true,
// "x-component-props": {
// showTime: true,
// format: 'YYYY-MM-DD HH:mm',
// disabledDate: current => {
// return current && current < moment().startOf('day')
// }
// }
// },
// }
// },
// deliveryAddresId: {
// type: 'string',
// "x-component": 'SelectAddress',
// "x-mega-props": {
// style: {
// full: true
// }
// },
// "x-component-props": {
// dataSource: [],
// times: 0,
// },
// "x-rules": [
// {
// required: true,
// message: '请选择交付地址'
// }
// ],
// title: '送货地址'
// }
// }
// }
// }
// }
// // 其他信息
// const ortherInfo: ISchema = {
// "x-index": 4,
// type: 'object',
// "x-component": 'tabpane',
// "x-component-props": {
// tab: '其他信息'
// },
// properties: {
// NO_SUBMIT_LAYOUT_ORTHER: {
// type: 'object',
// "x-component": 'mega-layout',
// "x-component-props": {
// labelAlign: 'left',
// labelCol: 4,
// wrapperCol: 10
// },
// properties: {
// hasInvoice: {
// type: 'boolean',
// "x-component": 'CheckboxSingle',
// "x-component-props": {
// children: '需要发票',
// style: {
// marginTop: 4,
// }
// },
// title: '发票',
// default: false,
// "x-linkages": [
// {
// type: 'value:visible',
// target: 'theInvoiceId',
// condition: "{{$value}}"
// }
// ]
// },
// theInvoiceId: {
// type: 'number',
// title: ' ',
// "x-component": "theInvoiceList",
// "x-component-props": {
// times: 0,
// }
// },
// pack: {
// type: 'string',
// "x-component": 'textarea',
// "x-component-props": {
// rows: 4
// },
// title: '包装要求',
// "x-rules": [
// {
// limitByte: true,
// maxByte: 100
// }
// ]
// },
// remark: {
// type: 'string',
// "x-component": 'textarea',
// "x-component-props": {
// rows: 4
// },
// title: '其他要求',
// "x-rules": [
// {
// limitByte: true,
// maxByte: 100
// }
// ]
// },
// }
// }
// }
// }
// // 新增时使用的schema
// export const orderAddSchema: ISchema = {
// type: 'object',
// properties: {
// NO_SUBMIT_TABS: {
// type: 'object',
// "x-component": 'tab',
// properties: {
// basicInfo,
// submitInfo,
// orderMaterial,
// ortherInfo,
// }
// }
// }
// }
// 基本信息
const basicInfo: ISchema = {
"x-index": 0,
......@@ -629,33 +317,6 @@ const ortherInfo: ISchema = {
columns: 2,
},
properties: {
// hasInvoice: {
// type: 'boolean',
// "x-component": 'CheckboxSingle',
// "x-component-props": {
// children: '需要发票',
// style: {
// marginTop: 4,
// }
// },
// title: '发票',
// default: false,
// "x-linkages": [
// {
// type: 'value:visible',
// target: 'theInvoiceId',
// condition: "{{$value}}"
// }
// ]
// },
// theInvoiceId: {
// type: 'number',
// title: ' ',
// "x-component": "theInvoiceList",
// "x-component-props": {
// times: 0,
// }
// },
pack: {
type: 'string',
"x-component": 'textarea',
......
......@@ -30,7 +30,7 @@ const DescriptionsInfo: React.FC<BasicInfoProps> = ({cardTitle, type, styles}) =
{
span: 8,
fieldList: [
{ title: '请单号:', name: 'requisitionNo' },
{ title: '请单号:', name: 'requisitionNo' },
{ title: '请购单摘要:', name: 'digest' },
{ title: '创建人:', name: 'creator' },
{ title: '单据时间:', name: 'createTime' },
......
......@@ -197,7 +197,7 @@ export const baseOrderListColumns: any = () => {
key: 'vendorMemberName',
},
{
title: '付日期',
title: '付日期',
align: 'center',
dataIndex: 'deliverTime',
key: 'deliverTime',
......
......@@ -27,6 +27,13 @@ const DepartmentModalTable:React.FC<DepartmentModalTableProps> = (props) => {
}
}, [])
useEffect(() => {
if(visible) {
const departmentId = schemaAction.getFieldValue('departmentId')
rowSelectionCtl.setSelectedRowKeys([departmentId])
}
}, [visible])
const handleConfirm = async () => {
const item = rowSelectionCtl.selectRow[0]
if (item) {
......
......@@ -2,7 +2,7 @@ import React, { useEffect } from 'react'
import { history } from 'umi'
import ModalTable, { ModalTableProps } from '@/components/ModalTable'
import { fetchOrderApi } from '../../apis'
import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'
import { FormEffectHooks, ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import Search from '@/components/NiceForm/components/Search'
......@@ -11,6 +11,10 @@ import Children from '@/components/NiceForm/components/Children';
import { addRequesitionMaterialSchema } from '../../schema/modal'
import { Button, Tooltip } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import { clearModalParams } from '@/utils'
import CustomCategorySearch from '@/components/NiceForm/components/CustomCategorySearch'
import CustomInputSearch from '@/components/NiceForm/components/CustomInputSearch'
import { searchBrandOptionEffect, searchCustomerCategoryOptionEffect } from '../../effects'
export interface MaterialModalTableProps extends ModalTableProps {
type?: 'radio' | 'checkbox',
......@@ -90,9 +94,10 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
temp.code = v.code;
temp.name = v.name;
temp.type = v.type;
temp.category = v.customerCategory.name;
temp.brand = v?.brand?.name || null;
temp.unit = v.unitName;
// 处理两套不同字段
temp.category = v?.customerCategory?.name || v?.category || null;
temp.brand = v?.brand?.name || v?.brand || null;
temp.unit = v?.unitName || v?.unit || null;
return temp
})
let originIds = tempOriginData.map(item => item.id)
......@@ -106,12 +111,16 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
}
const handleConfirm = async () => {
console.log(rowSelectionCtl, 'rowSelectionCtl')
const materialData = schemaAction.getFieldValue('products')
schemaAction.setFieldValue('products', addMaterialProcessField(rowSelectionCtl.selectRow, materialData))
confirmModal && confirmModal()
setVisible(false)
clearModalParams()
}
const handleCancel = () => {
setVisible(false)
clearModalParams()
}
const otherHandle = <>
......@@ -128,7 +137,7 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
columns={materialColumns}
visible={visible}
confirm={handleConfirm}
cancel={() => setVisible(false)}
cancel={handleCancel}
fetchTableData={fetchOrderApi.getPurchaseRequesitionMaterielList}
rowSelection={rowSelection}
resetModal={{destroyOnClose: true}}
......@@ -145,7 +154,13 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
formilyProps={{
ctx: {
schema: addRequesitionMaterialSchema,
components: { ModalSearch: Search, Submit, Children },
components: {
ModalSearch: Search,
Submit,
Children,
CustomInputSearch,
CustomCategorySearch
},
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
......@@ -153,6 +168,12 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
'code',
FORM_FILTER_PATH,
);
FormEffectHooks.onFieldChange$('brandId').subscribe(() => {
searchBrandOptionEffect(actions, 'brandId')
})
FormEffectHooks.onFieldChange$('customerCategoryId').subscribe(() => {
searchCustomerCategoryOptionEffect(actions, 'customerCategoryId')
})
},
expressionScope: {
otherHandle
......
......@@ -160,7 +160,7 @@ export const MaterialTableCell:React.FC<MaterialTableCellProps> = ({
] : [
{
pattern: /^\d+(\.\d{1,4})?$/,
message: '单价仅限位小数',
message: '单价仅限位小数',
},
{
validator: validatorNumber
......
import { formatTimeString } from '@/utils'
/** 修改请购单 初始值转换 */
export const procurmentRenderInit = (initValue: any) => {
......@@ -13,6 +11,7 @@ export const procurmentRenderInit = (initValue: any) => {
innerStatusName: initValue.innerStatusName,
createTime: initValue.createTime,
department: initValue.department,
departmentId: initValue.departmentId,
requisitionId: initValue.requisitionId,
deliverTime: initValue.deliverTime,
creator: initValue.creator,
......
......@@ -21,20 +21,24 @@ export const useMaterialTableChangeForAmount = (ctx: ISchemaFormActions | ISchem
})
}
// 高级筛选schema中用于输入搜索品牌的Effect
export const searchBrandOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetSelectBrand({ name: state.props['x-component-props'].searchValue }).then(res => {
context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
})
})
}
// 高级筛选schema中用于输入搜索商品品类的Effect
/**
* @param ctx 外部表单action
* @param mctx 模态框表单action
* @param fieldName 字段名称
*/
export const searchCustomerCategoryOptionEffect = (ctx: any, mctx: any, fieldName: string) => {
const params: any = {}
params['memberId'] = ctx.getFieldValue('supplyMembersId')
params['memberRoleId'] = ctx.getFieldValue('supplyMembersRoleId')
mctx.getFieldState(fieldName, state => {
PublicApi.getProductCustomerGetMemberCustomerCategoryTree(params).then(res => {
mctx.setFieldState(fieldName, state => {
export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
PublicApi.getProductCustomerGetCustomerCategoryTree().then(res => {
context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
})
......
import React, { useRef, useState, useEffect } from 'react'
import { history } from 'umi'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import ReutrnEle from '@/components/ReturnEle'
import { usePageStatus } from '@/hooks/usePageStatus'
import { Button, Card, Col, message, Row } from 'antd'
import { createFormActions, registerVirtualBox, useFormSpy } from '@formily/antd'
......@@ -25,7 +23,7 @@ import { useFormDetail } from '@/formSchema/effects/useFormDetail'
const addSchemaAction = createFormActions()
const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...props}>
const RowStyle = styled(props => <Row style={{marginTop: 12, justifyContent: "flex-end"}} justify='end' {...props}>
{props.children}
</Row>)`
.ant-col {
......@@ -148,16 +146,6 @@ const IncreaseRequisition:React.FC<{}> = () => {
}
return (<div>
{/* <PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回"/>}
title={changeRouterTitleByStatus()}
extra={[
<Button key="1" onClick={() => addSchemaAction.submit()} loading={btnLoading} type="primary" icon={<SaveOutlined />}>
保存
</Button>,
]}
> */}
<FormDetailContext.Provider value={providerValue}>
<FormDetailHeader
title={id ? '编辑请购单' : '新增请购单'}
......
import { ISchema } from '@formily/antd';
import moment from 'moment'
// // 基本信息
// const basicInfo: ISchema = {
// "x-index": 0,
// type: 'object',
// "x-component": 'tabpane',
// "x-component-props": {
// tab: '基本信息',
// className: 'useConnectBtnWrapper'
// },
// properties: {
// NO_SUBMIT_LAYOUT: {
// type: 'object',
// "x-component": 'mega-layout',
// "x-component-props": {
// labelCol: 4,
// labelAlign: 'left',
// wrapperCol: 10
// },
// properties: {
// requisitionNo: {
// type: 'string',
// title: '请购单号',
// "x-component": 'text',
// visible: false
// },
// digest: {
// type: 'string',
// title: '订单摘要',
// "x-rules": [
// {
// required: true,
// message: '请输入订单摘要'
// },
// {
// limitByte: true,
// maxByte: 60
// }
// ]
// },
// deliverTime: {
// type: 'string',
// "x-component": 'date',
// title: '预交日期',
// required: true,
// "x-component-props": {
// // showTime: true,
// format: 'YYYY-MM-DD',
// disabledDate: current => {
// return current && current < moment().startOf('day')
// },
// style: { width: '100%' }
// }
// },
// department: {
// type: 'string',
// title: '请购部门',
// required: true,
// "x-component-props": {
// disabled: true,
// addonAfter: "{{departmentBtn}}"
// },
// },
// departmentId: {
// type: 'string',
// title: '请购部门ID',
// visible: false,
// },
// purpose: {
// type: 'string',
// title: '请购用途',
// "x-rules": [
// {
// required: true,
// message: '请输入请购用途'
// },
// {
// limitByte: true,
// maxByte: 100
// }
// ]
// },
// vendorMemberName: {
// type: 'string',
// title: '供应会员',
// "x-component-props": {
// disabled: true,
// addonAfter: "{{memberBtn}}"
// },
// required: true,
// },
// vendorMemberId: {
// type: 'string',
// display: false
// },
// vendorRoleId: {
// type: 'string',
// display: false
// },
// createTime: {
// type: 'string',
// title: '单据时间',
// visible: false
// },
// interiorStateName: {
// type: 'string',
// title: '内部状态',
// visible: false
// },
// }
// },
// }
// }
// // 请购单物料
// export const material: ISchema = {
// "x-index": 2,
// type: 'object',
// "x-component": 'tabpane',
// "x-component-props": {
// tab: '订单物料'
// },
// properties: {
// products: {
// type: 'array',
// "x-component": 'MultTable',
// "x-component-props": {
// rowKey: 'materialId',
// columns: "{{materialColumns}}",
// components: "{{materialComponents}}",
// prefix: "{{materialAddButton}}",
// },
// },
// NO_SUBMIT_SPY: {
// type: 'object',
// "x-component": "moneyTotalBox"
// }
// }
// }
// // 新增请购单
// export const increaseSchema: ISchema = {
// type: 'object',
// properties: {
// NO_SUBMIT_TABS: {
// type: 'object',
// "x-component": 'tab',
// properties: {
// basicInfo,
// material,
// }
// }
// }
// }
// 基本信息
const basicInfo: ISchema = {
"x-index": 0,
......
......@@ -11,7 +11,7 @@ import { ISchema } from '@formily/antd';
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '请输入物料编号',
placeholder: '请输入号',
align: 'flex-start',
},
},
......@@ -20,7 +20,8 @@ import { ISchema } from '@formily/antd';
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
// flexWrap: 'nowrap',
justifyContent: 'flex-start',
style: {
marginRight: 0,
}
......@@ -33,13 +34,42 @@ import { ISchema } from '@formily/antd';
name: {
type: 'string',
'x-component-props': {
placeholder: '物料名称',
placeholder: '货品名称',
style: { width: '174px' },
},
},
brandId: {
type: 'string',
'x-component': 'CustomInputSearch',
'x-component-props': {
placeholder: '商品品牌',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px' },
searchValue: null,
dataoption: [],
},
},
customerCategoryId: {
type: 'string',
'x-component': 'CustomCategorySearch',
'x-component-props': {
placeholder: '商品品类',
showSearch: true,
notFoundContent: null,
style: { width: '174px' },
dataoption: [],
fieldNames: { label: 'title', value: 'id', children: 'children' },
},
},
type: {
type: 'string',
"x-component-props": {
placeholder: '规格型号',
style: { width: '174px' },
}
},
submit: {
......
......@@ -4,6 +4,7 @@ import { PublicApi } from '@/services/api'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { history } from 'umi'
import TableOperation from '@/components/TableOperation'
import { Modal } from 'antd'
// 待新增请购单 Hook
export const useSelfTable = () => {
......@@ -16,8 +17,13 @@ export const useSelfTable = () => {
}
const handleDelete = async (id) => {
await PublicApi.postPurchaseRequisitionDelete({id})
ref.current.reload()
Modal.confirm({
title: "是否执行删除操作?",
onOk: async () => {
await PublicApi.postPurchaseRequisitionDelete({id})
ref.current.reload()
}
})
}
const handleEdit = (record: any) => {
......
......@@ -274,12 +274,13 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
telephone: addressDetail.tel,
defaultConsignee: !!addressDetail.isDefault,
}
// 组合配送时间字段
if(params?.timeLine) {
params.deliverPeriod = `${params.deliverDate} ${params.timeLine}`
} else {
params.deliverPeriod = params.deliverDate
}
}
// 组合配送时间字段
if(params?.timeLine) {
params.deliverPeriod = `${params.deliverDate} ${params.timeLine}`
} else {
params.deliverPeriod = params.deliverDate
}
// 其他需求
......
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