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

fix:

parent 481720ea
// @统一处理 业务表格内不嵌套NiceForm组件的高级筛选 间距异常问题 // @统一处理 业务表格内不嵌套NiceForm组件的高级筛选 间距异常问题
// .god-schema-form { .god-schema-form {
// & > .ant-form-item { & > .ant-form-item {
// margin-bottom: 0 !important; margin-bottom: 0 !important;
// } }
// & > .ant-row-end { & > .ant-row-end {
// margin-top: 24px !important; margin-top: 24px !important;
// } }
// } }
.adjustFormItem { .adjustFormItem {
......
...@@ -10,20 +10,10 @@ const OrderPreview: React.FC = () => { ...@@ -10,20 +10,10 @@ const OrderPreview: React.FC = () => {
const { formContext, detailList } = useBillDetail({type: 'requestBill'}) const { formContext, detailList } = useBillDetail({type: 'requestBill'})
const anchorTitleList = [ const anchorTitleList = [
// { title: '流转进度', id: 'transferProcess', componentName: "TransferProcess" }, { title: '流转进度', id: 'transferProcess', componentName: "TransferProcess" },
// { title: '基本信息', id: 'baseicInfo', type: "basicInfo" }, { title: '基本信息', id: 'baseicInfo', type: "basicInfo" },
// { title: '招标物料', id: 'bidMaterial', componentName: "BidMaterial" }, { title: '招标物料', id: 'billMaterial', componentName: "BillMaterial" },
// { title: '招标要求', id: 'bidNeed', type: "bidNeed" }, { title: '流转记录', id: 'transferRecord', componentName: "TransformRecord" },
// { title: '报名要求', id: 'registerNeed', type: "registerNeed" },
// { title: '报名信息', id: 'registerInfoList', componentName: "RegisterInfoList", type: "registerList" },
// { title: '资格预审要求', id: 'checkNeed', type: "checkNeed" },
// { title: '资格预审信息', id: 'preCheckInfoList', componentName: "RegisterInfoList", type: "preCheckList" },
// { title: '评标要求', id: 'remarkNeed', type: "remarkNeed" },
// { title: '评标报告', id: 'remarkBidReport', componentName: "RemarkBidReport" },
// { title: '其他要求', id: 'otherNeed', type: "otherNeed" },
// { title: '招标方式', id: 'bidWay', componentName: "BidMethod" },
// { title: '招标结果', id: 'bidConfirm', componentName: "BidConfirm" },
// { title: '流转记录', id: 'transferRecord', componentName: "BidTransformRecord" },
] ]
......
import React, { ReactNode, useCallback, useEffect, useRef, useState } from 'react' import React, { ReactNode, useEffect, useRef, useState } from 'react'
import { Row, Col, Skeleton, Anchor } from 'antd' import { Row, Col, Skeleton, Anchor } from 'antd'
import { history } from 'umi' import { history } from 'umi'
import { ArrowLeftOutlined, BugTwoTone } from '@ant-design/icons' import { ArrowLeftOutlined } from '@ant-design/icons'
import style from './index.less' import style from './index.less'
const { Link } = Anchor; const { Link } = Anchor;
...@@ -79,7 +79,7 @@ const BillDetailHeader: React.FC<BillDetailHeaderProps> = ({ ...@@ -79,7 +79,7 @@ const BillDetailHeader: React.FC<BillDetailHeaderProps> = ({
<ArrowLeftOutlined onClick={() => backLink ? history.push(backLink) : history.goBack()} /> <ArrowLeftOutlined onClick={() => backLink ? history.push(backLink) : history.goBack()} />
</Col> </Col>
<Col> <Col>
<div className={style.titleAvatorText}>{formContext.data.projectName || formContext.data.inviteTender.projectName}&nbsp;|&nbsp;{formContext.data.code || formContext.data.inviteTender.code}</div> <div className={style.titleAvatorText}>{formContext.data.orderNo}</div>
</Col> </Col>
</Row> </Row>
<Row> <Row>
......
import React, { useEffect } from 'react' import React, { useEffect } from 'react'
import { findLastIndexFlowState } from '@/utils' import { findLastIndexFlowState } from '@/utils'
import style from './index.less' import style from './index.less'
// import TransferProcess from '../transferProcess' import DescriptionsInfo from '../descriptionsInfo'
// import DescriptionsInfo from '../descriptionsInfo' import BillMaterial from '../billMaterial'
// import BidMaterial from '../bidMaterial' import TransferProcess from '../transferProcess'
// import BidMethod from '../bidMethod' import TransformRecord from '../transferRecord'
// import BidTransformRecord from '../transferRecord'
// import BidParticulars from '../bidParticulars'
// import RemarkBidReport from '../remarkBidReport'
// import ParticipateInfo from '../participateInfo'
// import BidConfirm from '../bidConfirm'
// import MemberWinInfo from '../memberWinInfo'
// import RegisterInfoList from '../registerInfoList'
export interface BillDetailSectionProps { export interface BillDetailSectionProps {
formContext: any, formContext: any,
type: 'requestBill' type: 'requestBill'
...@@ -24,42 +16,17 @@ const BillDetailSection:React.FC<BillDetailSectionProps> = ({ ...@@ -24,42 +16,17 @@ const BillDetailSection:React.FC<BillDetailSectionProps> = ({
anchorList = [], anchorList = [],
}) => { }) => {
useEffect(() => { // 名称与组件映射
// 获取各个子div距父级的高度 const NameMapComponent = {
let floors = document.querySelectorAll(".anchorContent>div") // 流转进度组件
let tempArr = [] "TransferProcess": TransferProcess,
floors.forEach((floor: any, index: any) => { // 信息 基本信息组件
tempArr.push(floor.offsetTop) "DescriptionsInfo": DescriptionsInfo,
}) // 请购组件
// 各内容div存入context "BillMaterial": BillMaterial,
formContext.ctl.setOffsetTopList(tempArr) // 流转记录组件
}, []) "TransformRecord": TransformRecord,
}
// // 名称与组件映射
// const NameMapComponent = {
// // 流转进度组件
// "TransferProcess": TransferProcess,
// // 信息 基本信息组件
// "DescriptionsInfo": DescriptionsInfo,
// // 物料组件
// "BidMaterial": BidMaterial,
// // 招标方式组件
// "BidMethod": BidMethod,
// // 流转记录组件
// "BidTransformRecord": BidTransformRecord,
// // 中标明细组件
// "BidParticulars": BidParticulars,
// // 评标报告
// "RemarkBidReport": RemarkBidReport,
// // 会员参标信息
// "ParticipateInfo": ParticipateInfo,
// // 招标定标
// "BidConfirm": BidConfirm,
// // 会员中标信息
// "MemberWinInfo": MemberWinInfo,
// // 报名信息列表
// "RegisterInfoList": RegisterInfoList,
// }
const RenderDetailSection = ({ componentList }) => { const RenderDetailSection = ({ componentList }) => {
if(componentList && componentList.length > 0) { if(componentList && componentList.length > 0) {
...@@ -73,63 +40,42 @@ const BillDetailSection:React.FC<BillDetailSectionProps> = ({ ...@@ -73,63 +40,42 @@ const BillDetailSection:React.FC<BillDetailSectionProps> = ({
const RenderCertainContent = ({ title, type = null, componentName = null }) => { const RenderCertainContent = ({ title, type = null, componentName = null }) => {
let RcDom: any = null; let RcDom: any = null;
// switch(componentName) { switch(componentName) {
// //@todo 需另外调用接口获取数据 //@todo 需另外调用接口获取数据
// case 'TransferProcess': case 'TransferProcess':
// RcDom = (<TransferProcess RcDom = (<TransferProcess
// cardTitle={title} cardTitle={title}
// customTitleKey='name' customTitleKey='name'
// customKey='id' customKey='id'
// outerVerifyCurrent={findLastIndexFlowState(formContext.externalWorkflowFlowRecordLogResponses)} outerVerifyCurrent={findLastIndexFlowState(formContext.externalWorkflowFlowRecordLogResponses)}
// innerVerifyCurrent={findLastIndexFlowState(formContext.interiorWorkflowFlowRecordLogResponses)} innerVerifyCurrent={findLastIndexFlowState(formContext.interiorWorkflowFlowRecordLogResponses)}
// outerVerifySteps={ outerVerifySteps={
// formContext.externalWorkflowFlowRecordLogResponses ? formContext.externalWorkflowFlowRecordLogResponses ?
// formContext.externalWorkflowFlowRecordLogResponses.map(item => ({ formContext.externalWorkflowFlowRecordLogResponses.map(item => ({
// ...item, ...item,
// status: item.isActive ? 'finish' : 'wait', status: item.isActive ? 'finish' : 'wait',
// })) : })) :
// [] []
// } }
// innerVerifySteps={ innerVerifySteps={
// formContext.interiorWorkflowFlowRecordLogResponses ? formContext.interiorWorkflowFlowRecordLogResponses ?
// formContext.interiorWorkflowFlowRecordLogResponses.map(item => ({ formContext.interiorWorkflowFlowRecordLogResponses.map(item => ({
// ...item, ...item,
// status: item.isActive ? 'finish' : 'wait', status: item.isActive ? 'finish' : 'wait',
// })) : })) :
// [] []
// } }
// ></TransferProcess>) ></TransferProcess>)
// break; break;
// case "BidMaterial": case "BiillMaterial":
// RcDom = (<BidMaterial cardTitle={title} />) RcDom = (<BillMaterial cardTitle={title} />)
// break; break;
// case "BidMethod": case "TransformRecord":
// RcDom = (<BidMethod cardTitle={title} />) RcDom = (<TransformRecord cardTitle={title} />)
// break; break;
// case "BidTransformRecord": default:
// RcDom = (<BidTransformRecord cardTitle={title} />) RcDom = (<DescriptionsInfo cardTitle={title} type={type} />)
// break; }
// case "BidParticulars":
// RcDom = (<BidParticulars cardTitle={title} />)
// break;
// case "RemarkBidReport":
// RcDom = (<RemarkBidReport cardTitle={title} />)
// break;
// case "ParticipateInfo":
// RcDom = (<ParticipateInfo cardTitle={title} />)
// break;
// case "BidConfirm":
// RcDom = (<BidConfirm cardTitle={title} />)
// break;
// case "MemberWinInfo":
// RcDom = (<MemberWinInfo cardTitle={title} />)
// break;
// case "RegisterInfoList":
// RcDom = (<RegisterInfoList cardTitle={title} type={type} />)
// break;
// default:
// RcDom = (<DescriptionsInfo cardTitle={title} type={type} />)
// }
return RcDom; return RcDom;
} }
......
...@@ -4,10 +4,8 @@ import MellowCard from '@/components/MellowCard' ...@@ -4,10 +4,8 @@ import MellowCard from '@/components/MellowCard'
import { BidDetailContext } from '@/pages/procurement/_public/bid/context'; import { BidDetailContext } from '@/pages/procurement/_public/bid/context';
import { QuestionCircleOutlined } from '@ant-design/icons'; import { QuestionCircleOutlined } from '@ant-design/icons';
import style from './index.less' import style from './index.less'
import BASE_CONFIG from '../../../../../config/base.config.json' import { CALLFORBID_TYPE } from '@/constants/procurement';
import { CALLFORBID_TYPE, INVITE_BID } from '@/constants/procurement';
import { ENTERPRISE_CENTER_URL } from '@/constants' import { ENTERPRISE_CENTER_URL } from '@/constants'
const shopInfo = BASE_CONFIG.web.shopInfo
/** /**
* 请购单 请购物料 * 请购单 请购物料
...@@ -83,25 +81,7 @@ const BidMethod: React.FC<BidMethodProps> = ({cardTitle}) => { ...@@ -83,25 +81,7 @@ const BidMethod: React.FC<BidMethodProps> = ({cardTitle}) => {
<Col><p>{CALLFORBID_TYPE[data.inviteTenderType]}</p></Col> <Col><p>{CALLFORBID_TYPE[data.inviteTenderType]}</p></Col>
</Row> </Row>
</div> </div>
{ <Table dataSource={data.memberList} columns={columns} pagination={{size: "small"}} />
data.inviteTenderType === INVITE_BID ?
<Table dataSource={data.memberList} columns={columns} pagination={{size: "small"}} />
:
<div className={style['card-list']}>
<Row>
<Col span={2}><p className={style['card-list_title']}>发布商城</p></Col>
<Col>
<p>
{
data.inviteTenderShopList.map(item => {
return shopInfo.find(_item => _item.type === item.type && _item.environment === item.environment)['name']
}).join(' / ')
}
</p>
</Col>
</Row>
</div>
}
</MellowCard>) </MellowCard>)
} }
......
...@@ -3,13 +3,11 @@ import { Table, Radio } from 'antd' ...@@ -3,13 +3,11 @@ import { Table, Radio } from 'antd'
import { formatTimeString } from '@/utils' import { formatTimeString } from '@/utils'
import { BidDetailContext } from '@/pages/procurement/_public/bid/context'; import { BidDetailContext } from '@/pages/procurement/_public/bid/context';
import MellowCard from '@/components/MellowCard' import MellowCard from '@/components/MellowCard'
import CustomTag from '../customTag';
import { TransferEnum } from '../transferProcess'; import { TransferEnum } from '../transferProcess';
import style from './index.less' import style from './index.less'
import { BidInOpeartTexts, BidOutOpeartTexts } from '@/constants/procurement';
/** /**
* 招标流转记录 * 请购订单流转记录
*/ */
export interface BidTransformRecordProps { export interface BidTransformRecordProps {
...@@ -42,7 +40,6 @@ const BidTransformRecord:React.FC<BidTransformRecordProps> = ({cardTitle}) => { ...@@ -42,7 +40,6 @@ const BidTransformRecord:React.FC<BidTransformRecordProps> = ({cardTitle}) => {
dataIndex: 'statusValue', dataIndex: 'statusValue',
align: 'center', align: 'center',
key: 'statusValue', key: 'statusValue',
render: (text, r) => <CustomTag text={text} color={r.statusColor} />
}, },
{ {
title: '操作', title: '操作',
...@@ -95,7 +92,6 @@ const BidTransformRecord:React.FC<BidTransformRecordProps> = ({cardTitle}) => { ...@@ -95,7 +92,6 @@ const BidTransformRecord:React.FC<BidTransformRecordProps> = ({cardTitle}) => {
dataIndex: 'statusValue', dataIndex: 'statusValue',
align: 'center', align: 'center',
key: 'statusValue', key: 'statusValue',
render: (text, r) => <CustomTag text={text} color={r.statusColor} />
}, },
{ {
title: '操作', title: '操作',
......
...@@ -107,84 +107,55 @@ export const tableSearchListSchema: any = (align?: String, colStyle?: Object) => ...@@ -107,84 +107,55 @@ export const tableSearchListSchema: any = (align?: String, colStyle?: Object) =>
/** 采购 请购单查询 无内部状态schmea */ /** 采购 请购单查询 无内部状态schmea */
export const tableListSchema: any = (align?: String, colStyle?: Object) => { export const tableListSchema: any = (align?: String, colStyle?: Object) => {
return { return {
type: 'object', type: 'object',
properties: { properties: {
mageLayout: { orderNo: {
type: 'object', type: 'string',
'x-component': 'mega-layout', "x-component": 'SearchFilter',
properties: { 'x-component-props': {
topLayout: { placeholder: '请输入订单编号',
type: 'object', align: 'flex-end',
'x-component': 'mega-layout', },
'x-component-props': { },
grid: true, [FORM_FILTER_PATH]: {
}, type: 'object',
properties: { 'x-component': 'flex-layout',
orderNo: { 'x-component-props': {
type: 'string', inline: true,
"x-component": 'Search', colStyle: {
'x-component-props': { marginLeft: 20
placeholder: '请输入请购单号', },
align: 'flex-end', },
}, properties: {
} "digest": {
}, type: 'string',
}, 'x-component-props': {
[FORM_FILTER_PATH]: { placeholder: '请输入订单摘要',
type: 'object', }
'x-component': 'flex-layout', },
'x-component-props': { "memberName": {
rowStyle: { type: 'string',
flexWrap: 'nowrap', "x-component-props": {
}, placeholder: '请输入供应会员名称'
colStyle: { }
marginLeft: 20, },
}, "[startDate,endDate]": {
}, type: 'daterange',
'x-component-props': {
properties: { placeholder: ['开始时间','结束时间'],
"digest": {
type: 'string',
'x-component-props': {
placeholder: '请输入请购单摘要',
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
}
},
"department": {
type: 'string',
"x-component-props": {
placeholder: '请输入请购部门'
}
},
"purpose": {
type: 'string',
"x-component-props": {
placeholder: '请输入请购用途'
}
}, },
"[startDate,endDate]": { },
type: 'daterange', submit: {
// "x-component": 'DateRangePickerUnix', 'x-component': 'Submit',
'x-component-props': { 'x-component-props': {
placeholder: ['开始时间','结束时间'], children: '查询',
},
}, },
submit: { },
'x-component': 'Submit',
'x-component-props': {
children: '查询',
},
},
},}}
}, },
} },
} }
}
} }
/** 采购 请购单 公共列 */ /** 采购 请购单 公共列 */
......
...@@ -91,7 +91,7 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => { ...@@ -91,7 +91,7 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
temp.name = v.name; temp.name = v.name;
temp.type = v.type; temp.type = v.type;
temp.category = v.customerCategory.name; temp.category = v.customerCategory.name;
temp.brand = v.brand.name; temp.brand = v?.brand?.name || null;
temp.unit = v.unitName; temp.unit = v.unitName;
return temp return temp
}) })
...@@ -108,8 +108,8 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => { ...@@ -108,8 +108,8 @@ const MaterialModalTable:React.FC<MaterialModalTableProps> = (props) => {
const handleConfirm = async () => { const handleConfirm = async () => {
console.log(rowSelectionCtl, 'rowSelectionCtl') console.log(rowSelectionCtl, 'rowSelectionCtl')
const materialData = schemaAction.getFieldValue('materials') const materialData = schemaAction.getFieldValue('products')
schemaAction.setFieldValue('materials', addMaterialProcessField(rowSelectionCtl.selectRow, materialData)) schemaAction.setFieldValue('products', addMaterialProcessField(rowSelectionCtl.selectRow, materialData))
confirmModal && confirmModal() confirmModal && confirmModal()
setVisible(false) setVisible(false)
} }
......
...@@ -37,13 +37,6 @@ const MemberModalTable:React.FC<MemberModalTableProps> = (props) => { ...@@ -37,13 +37,6 @@ const MemberModalTable:React.FC<MemberModalTableProps> = (props) => {
} }
confirmModal && confirmModal() confirmModal && confirmModal()
setVisible(false) setVisible(false)
// 清空之前可能存在的商品支付信息数据
schemaAction.setFieldValue('materials', [])
schemaAction.setFieldValue('payments', [])
if(props?.productRef) {
props.productRef.current.rowSelectionCtl.setSelectRow([])
props.productRef.current.rowSelectionCtl.setSelectedRowKeys([])
}
} }
return ( return (
<ModalTable <ModalTable
......
import { formatTimeString } from '@/utils' import { formatTimeString } from '@/utils'
/** 修改合同下单 初始值转换 */ /** 修改请购单 初始值转换 */
export const procurmentRenderInit = (initValue: any) => { export const procurmentRenderInit = (initValue: any) => {
return { return {
...initValue.requirement.detail,
vendorMemberId: initValue.vendorMemberId, vendorMemberId: initValue.vendorMemberId,
vendorMemberName: initValue.vendorMemberName, vendorMemberName: initValue.vendorMemberName,
vendorRoleId: initValue.vendorRoleId, vendorRoleId: initValue.vendorRoleId,
product: initValue.product, product: initValue.product,
deliveryAddresId: initValue.consignee.consigneeId, requisitionNo: initValue.requisitionNo,
hasInvoice: initValue.hasInvoice, innerStatusName: initValue.innerStatusName,
orderId: initValue.orderId, createTime: initValue.createTime,
orderKind: initValue.orderKind, // 预留字段
orderMode: initValue.orderMode, shopId: initValue.shopId,
orderModeName: initValue.orderModeName, requisitionId: initValue.requisitionId,
type: initValue.orderTypeName,
digest: initValue.digest,
deliverDate: initValue.consignee.deliverDate,
theInvoiceId: initValue.invoice?.invoiceId || null,
hasContract: initValue.hasContract,
contractNo: initValue.contract.contractNo,
contract: {...initValue.contract},
} }
} }
/** 修改采购合同下单 回显商品字段转换 */ /** 修改请购单 回显商品字段转换 */
export const procurementRenderField = (data) => { export const procurementRenderField = (data) => {
const _orderProductRequests = data.product.products const _orderProductRequests = data.product.products
return _orderProductRequests.map(item => { return _orderProductRequests.map(item => {
return { return {
...item, ...item,
relevanceProductId: item.quotedSkuId,
relevanceProductName: item.quotedName,
relevanceProductBrand: item.quotedBrand,
relevanceProductCategory: item.quotedCategory,
relevanceProductSpec: item.quotedSpec,
logistics: item.deliverType,
id: item.productId, id: item.productId,
code: item.productNo, code: item.productNo,
type: item.spec, type: item.spec,
...@@ -54,13 +40,7 @@ export const procurementProcessField = (value) => { ...@@ -54,13 +40,7 @@ export const procurementProcessField = (value) => {
...item, ...item,
productId: item.id, productId: item.id,
productNo: item.code, productNo: item.code,
// 关联商品信息 spec: item.type,
// quotedProductId: item.relevanceProductId,
quotedSkuId: item.relevanceProductId,
quotedName: item.relevanceProductName,
quotedSpec: item.relevanceProductType,
quotedCategory: item.relevanceProductCategory,
quotedBrand: item.relevanceProductBrand,
} }
}) })
return value return value
......
...@@ -15,7 +15,7 @@ export const useEditHideField = () => { ...@@ -15,7 +15,7 @@ export const useEditHideField = () => {
} }
export const useMaterialTableChangeForAmount = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => { export const useMaterialTableChangeForAmount = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => {
FormEffectHooks.onFieldValueChange$('materials').subscribe(state => { FormEffectHooks.onFieldValueChange$('products').subscribe(state => {
// 强制渲染一次, 用于触发金额总数 // 强制渲染一次, 用于触发金额总数
update() update()
}) })
......
...@@ -35,18 +35,12 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {... ...@@ -35,18 +35,12 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
` `
// 总计金额联动框 // 总计金额联动框
export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => { export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', () => {
const { form } = useFormSpy({ selector: [['onFieldValueChange', 'materials']], reducer: v => v }) const { form } = useFormSpy({ selector: [['onFieldValueChange', 'products']], reducer: v => v })
const data = form.getFieldValue('materials') const data = form.getFieldValue('products')
const sum = data.reduce((prev, next) => (prev*1000 + (next.amount || 0)*1000)/1000, 0) const sum = data.reduce((prev, next) => (prev*1000 + (next.amount || 0)*1000)/1000, 0)
const total = data.reduce((prev, next) => (prev*1000 + (next.quantity || 0)*1000)/1000, 0) const total = data.reduce((prev, next) => (prev*1000 + (next.quantity || 0)*1000)/1000, 0)
// useEffect(() => {
// if (sum + freePrice) {
// form.notify('sumPrice', sum + freePrice)
// }
// }, [sum, freePrice])
return <RowStyle> return <RowStyle>
<Col span={2}> <Col span={2}>
<div>数量合计</div> <div>数量合计</div>
...@@ -59,7 +53,6 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => { ...@@ -59,7 +53,6 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
</RowStyle> </RowStyle>
}) })
/** 采购请购单 新增 */ /** 采购请购单 新增 */
const IncreaseRequisition:React.FC<{}> = () => { const IncreaseRequisition:React.FC<{}> = () => {
const departmentRef = useRef<any>({}) // 选部门 const departmentRef = useRef<any>({}) // 选部门
...@@ -76,13 +69,12 @@ const IncreaseRequisition:React.FC<{}> = () => { ...@@ -76,13 +69,12 @@ const IncreaseRequisition:React.FC<{}> = () => {
useEffect(() => { useEffect(() => {
if (id) { if (id) {
setFormLoading(true) setFormLoading(true)
PublicApi.getOrderBuyerCreateDetail({ orderId: id }).then(res => { PublicApi.getPurchaseRequisitionDetail({ id }).then(res => {
const { data } = res const { data } = res
const _orderProductRequests = procurementRenderField(data) const _orderProductRequests = procurementRenderField(data)
setInitFormValue(() => procurmentRenderInit(data)) setInitFormValue(() => procurmentRenderInit(data))
setTimeout(() => { setTimeout(() => {
addSchemaAction.setFieldValue('materials', _orderProductRequests) addSchemaAction.setFieldValue('products', _orderProductRequests)
addSchemaAction.setFieldValue('contract', {...data.contract})
}, 1000) }, 1000)
setFormLoading(false) setFormLoading(false)
}) })
...@@ -98,7 +90,7 @@ const IncreaseRequisition:React.FC<{}> = () => { ...@@ -98,7 +90,7 @@ const IncreaseRequisition:React.FC<{}> = () => {
console.log(value) console.log(value)
// 校验采购数量 // 校验采购数量
const judgementByCount = params.materials?.length && params.materials.map(item => { const judgementByCount = params.products?.length && params.products.map(item => {
if(item.quantity){ if(item.quantity){
return true return true
} else { } else {
...@@ -108,42 +100,18 @@ const IncreaseRequisition:React.FC<{}> = () => { ...@@ -108,42 +100,18 @@ const IncreaseRequisition:React.FC<{}> = () => {
if(!judgementByCount || judgementByCount.includes(false)){ if(!judgementByCount || judgementByCount.includes(false)){
throw new Error('请填写商品采购数量') throw new Error('请填写商品采购数量')
} }
// 使用发票即校验发票id
if(params.hasInvoice && !params.theInvoiceId) {
throw new Error('请新增或选择需要使用的发票')
}
setBtnLoading(true) setBtnLoading(true)
/** 字段转换 */
// 合同下单 取供应商默认的发货地址
const { data: deliveryAddress} = await PublicApi.getLogisticsSelectListMemberShipperAddress({
memberId: params.vendorMemberId,
roleId: params.vendorRoleId
})
params.materials = params.materials.map(item => {
const address = deliveryAddress[0]
return {
...item,
spec: item.type,
quotedSpec: item.relevanceProductType,
deliveryType: item.logistics,
addressId: address?.id || null,
address: address?.fullAddress || null,
receiver: address?.shipperName || null,
phone: address?.phone || null,
}
})
const _params = procurementProcessField(params) const _params = procurementProcessField(params)
console.log(_params) console.log(_params)
if(id) { if(id) {
fnResult = await PublicApi.postOrderBuyerCreateSrmUpdate({..._params, orderId: id}) fnResult = await PublicApi.postOrderBuyerCreateSrmUpdate({..._params, orderId: id})
} else { } else {
fnResult = await PublicApi.postOrderBuyerCreateSrm(_params) fnResult = await PublicApi.postPurchaseRequisitionCreate(_params)
} }
if (fnResult.code === 1000) { if (fnResult.code === 1000) {
setTimeout(() => { setTimeout(() => {
history.push("/memberCenter/tranactionAbility/purchaseOrder/readyAddSrmOrder") history.push("/memberCenter/procurementAbility/purchaseRequisition/readyAddBill")
}, 1000) }, 1000)
} else { } else {
setBtnLoading(false) setBtnLoading(false)
......
import React, { useRef, useState } from 'react' import { useRef, useState } from 'react'
import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'; import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
import { Button } from 'antd'; import { Button } from 'antd';
import { materialInfoColumns } from '../constant'; import { materialInfoColumns } from '../constant';
...@@ -7,16 +7,6 @@ import { useModalTable } from './useModalTable'; ...@@ -7,16 +7,6 @@ import { useModalTable } from './useModalTable';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'; import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
// 对象按key排序(运用于商城传过来的阶梯价格排序)
export const sortByKey = (params) => {
let keys = Object.keys(params).sort((x,y)=> parseInt(x) - parseInt(y));
let newParams = {};
keys.forEach((key) => {
newParams[key] = params[key];
});
return newParams;
}
export const getUnitPriceTotal = (record) => { export const getUnitPriceTotal = (record) => {
const purchaseCount = Number(record['quantity']) || 0 const purchaseCount = Number(record['quantity']) || 0
return Number(((record.price || 0) * purchaseCount).toFixed(2)) return Number(((record.price || 0) * purchaseCount).toFixed(2))
...@@ -30,7 +20,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio ...@@ -30,7 +20,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type: 'checkbox'}) const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type: 'checkbox'})
const handleDelete = (record) => { const handleDelete = (record) => {
const newData = [...ctx.getFieldValue('materials')] const newData = [...ctx.getFieldValue('products')]
// 删除formvalue // 删除formvalue
const colIndex = newData.findIndex(v => v.id === record.id) const colIndex = newData.findIndex(v => v.id === record.id)
newData.splice(colIndex, 1) newData.splice(colIndex, 1)
...@@ -38,7 +28,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio ...@@ -38,7 +28,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
// 删除选中的项 // 删除选中的项
rowSelectionCtl.setSelectRow(newData) rowSelectionCtl.setSelectRow(newData)
rowSelectionCtl.setSelectedRowKeys(newData.map(v => v.id)) rowSelectionCtl.setSelectedRowKeys(newData.map(v => v.id))
ctx.setFieldValue('materials', newData) ctx.setFieldValue('products', newData)
} }
...@@ -59,10 +49,10 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio ...@@ -59,10 +49,10 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
return materialInfoColumns return materialInfoColumns
}) })
const handleShowMaterial = () => { const handleShowMaterial = () => {
const materials = ctx.getFieldValue('materials') const products = ctx.getFieldValue('products')
materialRef.current.setVisible(true) materialRef.current.setVisible(true)
if(materials && materials.length) { if(products && products.length) {
materialRef.current.rowSelectionCtl.setSelectedRowKeys(() => materials.map(item => item.id)) materialRef.current.rowSelectionCtl.setSelectedRowKeys(() => products.map(item => item.id))
} }
} }
...@@ -76,7 +66,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio ...@@ -76,7 +66,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
const handleSave = row => { const handleSave = row => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('materials')]; const newData = [...ctx.getFieldValue('products')];
const index = newData.findIndex(item => row.id === item.id); const index = newData.findIndex(item => row.id === item.id);
const item = newData[index]; const item = newData[index];
// 算单行价格 // 算单行价格
...@@ -85,7 +75,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio ...@@ -85,7 +75,7 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
...item, ...item,
...row, ...row,
}); });
ctx.setFieldValue('materials', newData) ctx.setFieldValue('products', newData)
resolve({item, newData}) resolve({item, newData})
}) })
}; };
......
...@@ -20,7 +20,7 @@ const basicInfo: ISchema = { ...@@ -20,7 +20,7 @@ const basicInfo: ISchema = {
wrapperCol: 10 wrapperCol: 10
}, },
properties: { properties: {
orderNo: { requisitionNo: {
type: 'string', type: 'string',
title: '请购单号', title: '请购单号',
"x-component": 'text', "x-component": 'text',
...@@ -40,14 +40,14 @@ const basicInfo: ISchema = { ...@@ -40,14 +40,14 @@ const basicInfo: ISchema = {
} }
] ]
}, },
deliverDate: { deliverTime: {
type: 'string', type: 'string',
"x-component": 'date', "x-component": 'date',
title: '预交日期', title: '预交日期',
required: true, required: true,
"x-component-props": { "x-component-props": {
showTime: true, // showTime: true,
format: 'YYYY-MM-DD HH:mm', format: 'YYYY-MM-DD',
disabledDate: current => { disabledDate: current => {
return current && current < moment().startOf('day') return current && current < moment().startOf('day')
}, },
...@@ -103,7 +103,7 @@ const basicInfo: ISchema = { ...@@ -103,7 +103,7 @@ const basicInfo: ISchema = {
title: '单据时间', title: '单据时间',
visible: false visible: false
}, },
interiorState: { interiorStateName: {
type: 'string', type: 'string',
title: '内部状态', title: '内部状态',
visible: false visible: false
...@@ -123,7 +123,7 @@ export const material: ISchema = { ...@@ -123,7 +123,7 @@ export const material: ISchema = {
tab: '订单物料' tab: '订单物料'
}, },
properties: { properties: {
materials: { products: {
type: 'array', type: 'array',
"x-component": 'MultTable', "x-component": 'MultTable',
"x-component-props": { "x-component-props": {
......
// @统一处理 业务表格内不嵌套NiceForm组件的高级筛选 间距异常问题
.god-schema-form {
& > .ant-form-item {
margin-bottom: 0 !important;
}
& > .ant-row-end {
margin-top: 24px !important;
}
}
import React from 'react' import React from 'react';
import { history } from 'umi' import PreLoading from '@/components/PreLoading';
import { Card, Button, Space } from 'antd' import { useBillDetail } from '@/pages/transaction/_public/bill/effects/useBillDetail';
import { StandardTable } from 'god' import { BillDetailContext } from '@/pages/transaction/_public/bill/effects/context';
import { PageHeaderWrapper } from '@ant-design/pro-layout' import BillDetailHeader from '../../components/billDetailHeader';
import { PublicApi } from '@/services/api' import BillDetailWrapper from '../../components/billDetailWrapper';
import { PlusCircleOutlined } from '@ant-design/icons' import BillDetailSection from '../../components/billDetailSection';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' const RequisitionOrderDetail: React.FC = () => {
import Submit from '@/components/NiceForm/components/Submit' const { formContext, detailList } = useBillDetail({type: 'requestBill'})
import '../index.less'
import { tableListSchema } from '../../constant' const anchorTitleList = [
import { useSelfTable } from '../model/useRequisitionOrder' { title: '基本信息', id: 'baseicInfo', type: "basicInfo" },
{ title: '请购物料', id: 'billMaterial', componentName: "BillMaterial" },
// 请购单转订单 详情 ]
export interface RequesitionOrderDetailProps {} return (
<div>
const fetchTableData = async (params) => { <BillDetailContext.Provider value={formContext}>
const { data } = await PublicApi.getOrderBuyerCreatePage(params) <BillDetailHeader
return data formContext={formContext}
} anchorList={anchorTitleList}
/>
const RequesitionOrderDetail:React.FC<RequesitionOrderDetailProps> = () => { <BillDetailWrapper>
const { columns, ref } = useSelfTable() <PreLoading loading={!formContext.data} active paragraph={{ rows: 6 }}>
<BillDetailSection formContext={formContext} anchorList={anchorTitleList} type="requestBill" />
const clickAdd = () => { </PreLoading>
history.push(`/memberCenter/procurementAbility/purchaseRequisition/readyAddBill/add`) </BillDetailWrapper>
}
</BillDetailContext.Provider>
return <PageHeaderWrapper>
<Card> </div>
<StandardTable )
fetchTableData={params => fetchTableData(params)}
columns={columns}
currentRef={ref}
rowKey="orderId"
formilyLayouts={{
justify: 'space-between'
}}
formilyProps={{
ctx: {
inline: false,
schema: tableListSchema(),
effects: ($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'orderNo',
FORM_FILTER_PATH,
);
},
components: {
Submit
}
},
layouts: {
order: 2,
span: 16
}
}}
formilyChilds={{
children: <Space>
<Button
icon={<PlusCircleOutlined/>}
type='primary'
onClick={clickAdd}
>
新建
</Button>
</Space>,
layouts: {
span: 8
}
}}
/>
</Card>
</PageHeaderWrapper>
} }
RequesitionOrderDetail.defaultProps = {} export default RequisitionOrderDetail;
export default RequesitionOrderDetail
import React from 'react' import React from 'react'
import { history } from 'umi' import { Card } from 'antd'
import { Card, Button, Space } from 'antd'
import { StandardTable } from 'god' import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { PlusCircleOutlined } from '@ant-design/icons'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch' import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const' import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit' import Submit from '@/components/NiceForm/components/Submit'
...@@ -25,10 +23,6 @@ const fetchTableData = async (params) => { ...@@ -25,10 +23,6 @@ const fetchTableData = async (params) => {
const RequisitionOrder:React.FC<RequisitionOrderProps> = () => { const RequisitionOrder:React.FC<RequisitionOrderProps> = () => {
const { columns, ref } = useSelfTable() const { columns, ref } = useSelfTable()
const clickAdd = () => {
history.push(`/memberCenter/procurementAbility/purchaseRequisition/readyAddBill/add`)
}
return <PageHeaderWrapper> return <PageHeaderWrapper>
<Card> <Card>
<StandardTable <StandardTable
...@@ -58,21 +52,7 @@ const RequisitionOrder:React.FC<RequisitionOrderProps> = () => { ...@@ -58,21 +52,7 @@ const RequisitionOrder:React.FC<RequisitionOrderProps> = () => {
}, },
layouts: { layouts: {
order: 2, order: 2,
span: 16 span: 24
}
}}
formilyChilds={{
children: <Space>
<Button
icon={<PlusCircleOutlined/>}
type='primary'
onClick={clickAdd}
>
新建
</Button>
</Space>,
layouts: {
span: 8
} }
}} }}
/> />
......
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