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

fix:

parent 0bfec93f
...@@ -7,7 +7,6 @@ import StatusColors from '../StatusColors' ...@@ -7,7 +7,6 @@ import StatusColors from '../StatusColors'
import moment from 'moment' import moment from 'moment'
import { PayOutWorkState } from '@/constants' import { PayOutWorkState } from '@/constants'
import OverflowText from '@/components/OverflowText' import OverflowText from '@/components/OverflowText'
import { isTemplateExpression } from 'typescript'
import { QuestionCircleOutlined } from '@ant-design/icons' import { QuestionCircleOutlined } from '@ant-design/icons'
/** /**
...@@ -59,7 +58,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => { ...@@ -59,7 +58,7 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
{dataSource.payPrice || 0} {dataSource.payPrice || 0}
{ {
dataSource.refundPrice && dataSource.refundPrice &&
<Tooltip title={`本次实际支付金额(¥${data.payPrice-data.refundPrice})=本次订单待支付金额(¥${data.payPrice})-售后待退款金额(¥${data.refundPrice})`}> <Tooltip title={`本次实际支付金额(¥${data.payPrice})=本次订单待支付金额(¥${data.payPrice+data.refundPrice})-售后待退款金额(¥${data.refundPrice})`}>
<QuestionCircleOutlined /> <QuestionCircleOutlined />
</Tooltip> </Tooltip>
} }
......
...@@ -71,4 +71,10 @@ export const fetchOrderApi = { ...@@ -71,4 +71,10 @@ export const fetchOrderApi = {
return data return data
}, },
// 获取合并订单列表
async getMergeOrderList(params) {
const { data } = await PublicApi.getOrderMergeOrderList(params)
return data
},
} }
...@@ -40,7 +40,7 @@ const MergeOrderModalTable:React.FC<MergeOrderModalTableProps> = (props) => { ...@@ -40,7 +40,7 @@ const MergeOrderModalTable:React.FC<MergeOrderModalTableProps> = (props) => {
visible={visible} visible={visible}
confirm={handleConfirm} confirm={handleConfirm}
cancel={() => setVisible(false)} cancel={() => setVisible(false)}
fetchTableData={(params) => fetchOrderApi.getQuotationList(params)} fetchTableData={(params) => fetchOrderApi.getMergeOrderList(params)}
rowSelection={rowSelection} rowSelection={rowSelection}
modalType='MergeOrderByDefault' modalType='MergeOrderByDefault'
tableProps={{ tableProps={{
......
...@@ -33,6 +33,7 @@ import AuditProcess from '@/components/AuditProcess' ...@@ -33,6 +33,7 @@ import AuditProcess from '@/components/AuditProcess'
import styles from './index.less' import styles from './index.less'
import SimpleElectronModal from './components/simpleElectronModal' import SimpleElectronModal from './components/simpleElectronModal'
import { fetchOrderApi } from './apis' import { fetchOrderApi } from './apis'
import MergeOrderModalTable from './components/mergeOrderModalTable'
export interface PurchaseOrderDetailProps {} export interface PurchaseOrderDetailProps {}
...@@ -126,6 +127,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -126,6 +127,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const inquiryRef = useRef<any>({}) const inquiryRef = useRef<any>({})
const demandRef = useRef<any>({}) const demandRef = useRef<any>({})
const contractRef = useRef<any>({}) const contractRef = useRef<any>({})
const mergeRef = useRef<any>({})
const [formLoading, setFormLoading] = useState(false) const [formLoading, setFormLoading] = useState(false)
const [btnLoading, setBtnLoading] = useState(false) const [btnLoading, setBtnLoading] = useState(false)
const update = useUpdate() const update = useUpdate()
...@@ -154,7 +156,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -154,7 +156,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
addSchemaAction.getFieldValue('supplyMembersRoleId'), addSchemaAction.getFieldValue('supplyMembersRoleId'),
pageStatus === PageStatus.ADD ? addSchemaAction.getFieldValue('orderProductRequests') : initFormValue.orderProductRequests pageStatus === PageStatus.ADD ? addSchemaAction.getFieldValue('orderProductRequests') : initFormValue.orderProductRequests
) )
const { productAddButton, productRef, productColumns, productComponents, ...sectionProps } = useProductTable(addSchemaAction) const { productAddButton, productRef, productColumns, productComponents, ...sectionProps } = useProductTable(addSchemaAction, mergeRef)
let timerSignature = null let timerSignature = null
// 页面进入时, 当前所处的下单模式 // 页面进入时, 当前所处的下单模式
...@@ -542,31 +544,33 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -542,31 +544,33 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
// 商品信息的改动 驱动支付信息变化 // 商品信息的改动 驱动支付信息变化
useProductTableChangeForPay(ctx, update) useProductTableChangeForPay(ctx, update)
//编辑 地址和发票信息变动 触发订单更新 // 编辑 地址和发票信息变动 触发订单更新
useOrderUpdateChangeOther(ctx) useOrderUpdateChangeOther(ctx)
// address初始下只有id change后为object
// $('onFieldValueChange', 'NO_SUBMIT_TABS.*.*.*(theInvoiceId, needTheInvoice, deliveryAddresId)').subscribe(state => { // 合并订单模式下 只选择供应会员 出现选择商品按钮
// const { value, path } = state $('onFieldValueChange', 'supplyMembersName').subscribe(state => {
// if(pageStatus === PageStatus.EDIT){ const quotationOrderValue = ctx.getFieldValue('quotationNo')
// if(state?.dataSource?.length && state.loading) { const modelType = ctx.getFieldValue('orderModel')
// ctx.submit((values) => { if(state.value && !quotationOrderValue && modelType === 9) {
// console.log(value, path) addSchemaAction.setFieldState('orderProductRequests', productState => {
// if(values){ productState.props["x-component-props"] = {
// PublicApi.postOrderProcurementOrderUpdate({ ...productState.props["x-component-props"],
// ...values, prefix: productAddButton,
// deliveryTime: moment(values.deliveryTime).valueOf(), }
// theInvoiceId: value.id, })
// needTheInvoice: Number(values.needTheInvoice), }
// deliveryAddresId: path.indexOf("deliveryAddresId") !== -1 ? ( value?.id ? value.id : value ) : values.deliveryAddresId, })
// id, $('onFieldValueChange', 'quotationNo').subscribe(state => {
// }, { ctlType: "none" }) const modelType = ctx.getFieldValue('orderModel')
// } if(state.value && modelType === 9) {
// }) addSchemaAction.setFieldState('orderProductRequests', productState => {
// } else { productState.props["x-component-props"] = {
// ctx.setFieldState(path, _state => _state.loading = true) ...productState.props["x-component-props"],
// } prefix: "",
// } }
// }) })
}
})
}} }}
expressionScope={{ expressionScope={{
...@@ -598,6 +602,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -598,6 +602,9 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
{/* 简单流程签合同弹窗 */} {/* 简单流程签合同弹窗 */}
<SimpleElectronModal currentRef={contractRef} schemaAction={addSchemaAction}/> <SimpleElectronModal currentRef={contractRef} schemaAction={addSchemaAction}/>
{/* 选择待合并订单弹窗 */}
<MergeOrderModalTable currentRef={mergeRef} schemaAction={addSchemaAction} />
</ReadyAddOrderDetailContext.Provider> </ReadyAddOrderDetailContext.Provider>
</PageHeaderWrapper> </PageHeaderWrapper>
) )
......
...@@ -53,7 +53,12 @@ export const getUnitPriceTotal = (record) => { ...@@ -53,7 +53,12 @@ export const getUnitPriceTotal = (record) => {
return Number((unitPrice * purchaseCount).toFixed(2)) return Number((unitPrice * purchaseCount).toFixed(2))
} }
} }
export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
/**
* @param ctx schemaAction
* @param mergeRef 操作合并订单的ref
*/
export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, mergeRef: any) => {
const productRef = useRef<any>({}) const productRef = useRef<any>({})
const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type: 'checkbox'}) const { visible, setVisible, rowSelection, rowSelectionCtl } = useModalTable({type: 'checkbox'})
const { pageStatus } = usePageStatus() const { pageStatus } = usePageStatus()
...@@ -84,9 +89,13 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction ...@@ -84,9 +89,13 @@ export const useProductTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
const [productColumns, setProductColumns] = useState(() => { const [productColumns, setProductColumns] = useState(() => {
if (pageStatus === PageStatus.ADD) { if (pageStatus === PageStatus.ADD) {
productInfoColumns[productInfoColumns.length - 1].render = (text, record) => { productInfoColumns[productInfoColumns.length - 1].render = (text, record) => {
const orderModel = ctx.getFieldValue('orderModel')
return <> return <>
{
// 合并下单
orderModel === 9 && <Button type='link' onClick={() => mergeRef.current.setVisible(true)}>选择合并订单</Button>
}
<Button type='link' onClick={() => handleDelete(record)}>删除</Button> <Button type='link' onClick={() => handleDelete(record)}>删除</Button>
{/* <Button type='link'>选择合并订单</Button> */}
</> </>
} }
} else { } else {
......
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