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

fix: 修复新增属性勾选价格属性必须勾选必填项,处理前面非必填项价格属性组合出来的商品编辑出错问题

parent b2d5a596
......@@ -160,6 +160,14 @@ const AddAtttribute: React.FC<{}> = () => {
menuForm.setFieldsValue({ isDate: false })
}
const priceAttributeChange = (e) => {
if(e.target.checked) {
menuForm.setFieldsValue({"isEmpty": true})
} else {
menuForm.setFieldsValue({"isEmpty": false})
}
}
return <PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description={intl.formatMessage({ id: 'classAndProperty.attribute.addAttribute.back' })}/>}
......@@ -261,7 +269,7 @@ const AddAtttribute: React.FC<{}> = () => {
</Col> */}
<Col span={24}>
{/* 规格属性 -> 原价格属性 */}
<Form.Item name="isPrice" valuePropName="checked" initialValue={false} noStyle><Checkbox disabled={isSee}>{intl.formatMessage({ id: 'classAndProperty.attribute.addAttribute.form.isPrice' })}</Checkbox></Form.Item>
<Form.Item name="isPrice" valuePropName="checked" initialValue={false} noStyle><Checkbox onChange={priceAttributeChange} disabled={isSee}>{intl.formatMessage({ id: 'classAndProperty.attribute.addAttribute.form.isPrice' })}</Checkbox></Form.Item>
<Tooltip title={intl.formatMessage({ id: 'classAndProperty.attribute.addAttribute.form.isPrice.tooltip' })}>
<InfoCircleOutlined />
</Tooltip>
......
import React, { useCallback, useRef } from 'react';
import React from 'react';
import { OrderDetailContext } from '../../../_public/order/context';
import { Button } from 'antd';
import OrderDetailHeader from '@/pages/transaction/components/orderDetailHeader';
import OrderDetailWrapper from '@/pages/transaction/components/orderDetailWrapper';
import PreLoading from '@/components/PreLoading';
import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail';
import OrderHandDeleved from '../../../components/orderHandDeleved';
import OrderDetailSection from '../../../components/orderDetailSection';
import { usePageStatus } from '@/hooks/usePageStatus';
import { useIntl } from 'umi';
const ReadyConfirmDelevedOrderDetail: React.FC = () => {
const { formContext, id, detailList } = useOrderDetail({type: 's_readyConfirmDelevedOrder'})
const { batchNo } = usePageStatus()
const intl = useIntl()
// // 是否是手工发货
// const isHandDeleved = formContext.data && formContext.data.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER
// // 所有发货单都是否已经发货了
// const isShowBtn = isHandDeleved || formContext.data?.orderDeliveryDetailsResponses?.some(v => v.interiorState === DeliverySideState.ADD_LOGISTICS_ORDER)
// 是否发过货
// const isHandDeleved = Number(batchNo) <= 0
const isHandDeleved = true
// 是否发货完成
const approvedRef = useRef<any>({})
const handleClick = useCallback(() => {
if (isHandDeleved) {
approvedRef.current.setVisible(true)
} else {
const deleveBox = document.querySelector('#deleveBox') as any
window.scrollTo(0, deleveBox.offsetTop)
}
}, [isHandDeleved])
const ReadyDelevedOrderDetail: React.FC = () => {
const { formContext, detailList } = useOrderDetail({type: 'purchaseOrder'})
return (
<div>
<OrderDetailContext.Provider value={formContext}>
<OrderDetailHeader detailList={detailList} detailData={formContext.data} extraRight={
<Button type='primary' onClick={handleClick}>
{ isHandDeleved ? intl.formatMessage({ id: 'saleOrder.querenshougongfa', defaultMessage: '确认手工发货' }) : intl.formatMessage({ id: 'saleOrder.qufahuo', defaultMessage: '去发货' }) }
</Button>
} />
<OrderDetailHeader detailList={detailList} detailData={formContext.data}/>
<OrderDetailWrapper>
<PreLoading loading={!formContext.data} active paragraph={{rows: 6}}>
<OrderDetailSection formContext={formContext} type='saleOrder'/>
<OrderDetailSection formContext={formContext}/>
</PreLoading>
</OrderDetailWrapper>
{/* 提交时触发的弹窗集合 */}
<OrderHandDeleved
currentRef={approvedRef}
/>
</OrderDetailContext.Provider>
</div>
);
};
export default ReadyConfirmDelevedOrderDetail;
export default ReadyDelevedOrderDetail;
......@@ -21,7 +21,7 @@ export const useSelfTable = () => {
render: (text, record) => {
// 查看订单, 需根据状态显示不同schema
return (
<EyePreview url={`/memberCenter/tranactionAbility/saleOrder/readyConfirmDelevedOrder/preview?id=${record.orderId}`}>
<EyePreview url={`/memberCenter/tranactionAbility/purchaseOrder/readyDelevedOrder/detail?id=${record.orderId}`}>
{text}
</EyePreview>
)
......
......@@ -66,7 +66,7 @@ class ProductStore implements IProductModule {
tempObj[item] = attributeValueIdArr[index]
}
else if(this.attributeLists.filter(_item => _item.id === item)[0]?.type === 3){ // 输入
tempObj[item] = attributeValueArr[index][0].value
tempObj[item] = attributeValueArr[index][0]?.value || ''
}
else{
tempObj[item] = attributeValueIdArr[index][0]
......
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