Commit 8963abcc authored by 前端-李俊鑫's avatar 前端-李俊鑫

fix: 新增编辑通知单时离开提示

parent 0db89d17
......@@ -393,3 +393,7 @@ a {
}
}
}
.ant-btn {
border-radius: 4px;
}
......@@ -23,10 +23,11 @@ export function HarvestMaterialInput(props: {
keyup: string // dataSource 对应的row key
min?: number
disabled?: boolean
onValuesChange?: () => void
}) {
const context = useContext(HarvestMaterialContext);
const { value, index, keyup } = props;
const { value, index, keyup, onValuesChange } = props;
const [inputVal, setInputVal] = useState<any>(value)
const handleChange = (e) => {
......@@ -60,6 +61,7 @@ export function HarvestMaterialInput(props: {
dataSource[index][keyup] = val
context.dataSource = dataSource;
setInputVal(val)
onValuesChange?.()
}
......
......@@ -14,12 +14,12 @@ import { RoleSelect } from '@/components/RoleSelect'
import StandardTable from '@/components/StandardTable'
import DeliveryGoodTableSelect from '../../../../components/DeliveryGoodTableSelect/DeliveryGoodTableSelect';
import { HarvestMaterialContextProvider, HarvestMaterialInput } from '../../../../assets/context';
import { getLogisticsSelectListReceiverAddress } from '@/services/LogisticsV2Api'
import { postOrderDeliveryNoticeOrderB2bCreate, getOrderDeliveryNoticeOrderDetail, getOrderDeliveryNoticeOrderDeliveryHistory, getOrderDeliveryNoticeOrderDetailPage, postOrderDeliveryNoticeOrderUpdate } from '@/services/OrderNewV2Api'
import { BaseInfo as base_info, DeliveryGood, Remarks, ExternalRoamRecord, Circulation, Purchaser, SubmitDeliveryNotice, Supplier, ConfirmDeliveryNotice, NoticeSummary, BuyerLabel, DeliveryDate, DeliveryTime, ReceivingAddress, ShippingInfo } from '../../../../constants'
import { BrandColumn, ClassColumn, FlowOptionsColumn, MaterialModelColumn, CommodityNoColumn, TradeNameColumn, OrderCreatedAtColumn, OrderNoColumn, OrderNumColumn, UntilColumn } from '../../../../constants/table-column'
import { ExternalRoamRecordTableColumn } from '../../../../constants/page-table-column'
import moment from 'moment'
import usePrompt from '@/hooks/usePrompt';
type PropsType = {
type: 'add' | 'edit';
......@@ -54,6 +54,7 @@ const getConst = (len = 0) => {
const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id, planData, btnCode }) => {
const [form] = Form.useForm()
const { renderPrompt, handleLeave } = usePrompt()
const [historyData, setHistoryData] = useState<any>([])
const [tableDataSource, setTableDataSource] = useState<any[]>()
const [loading, setLoading] = useState<boolean>(false)
......@@ -203,6 +204,7 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
value={rcode['planCount']}
index={index}
keyup="planCount"
onValuesChange={() => { handleLeave() }}
/>
)
}
......@@ -228,7 +230,7 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
</AuthButton>
}
>
<Form labelAlign='left' form={form}>
<Form labelAlign='left' form={form} onValuesChange={() => { handleLeave() }}>
<BaseInfo className='mt-0' title={base_info.name} id={base_info.key}>
<Form.Item hidden name='planNo'><Input/></Form.Item>
<Form.Item
......@@ -357,6 +359,7 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
)
}
</Form>
{renderPrompt()}
</AnchorPage>
)
}
......
......@@ -15,12 +15,12 @@ import { RoleSelect } from '@/components/RoleSelect'
import StandardTable from '@/components/StandardTable'
import DeliveryGoodTableSelect from '../../../../components/DeliveryGoodTableSelect/DeliveryGoodTableSelect';
import { HarvestMaterialContextProvider, HarvestMaterialInput } from '../../../../assets/context';
import { getLogisticsSelectListReceiverAddress } from '@/services/LogisticsV2Api'
import { postOrderDeliveryNoticeOrderSrmCreate, getOrderDeliveryNoticeOrderDetail, getOrderDeliveryNoticeOrderDeliveryHistory, getOrderDeliveryNoticeOrderDetailPage, postOrderDeliveryNoticeOrderUpdate } from '@/services/OrderNewV2Api'
import { BaseInfo as base_info, Material, Remarks, ExternalRoamRecord, Circulation, Purchaser, SubmitDeliveryNotice, Supplier, ConfirmDeliveryNotice, NoticeSummary, BuyerLabel, DeliveryDate, DeliveryTime, ReceivingAddress, ShippingInfo } from '../../../../constants'
import { BrandColumn, ClassColumn, FlowOptionsColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderNumColumn, UntilColumn } from '../../../../constants/table-column'
import { ExternalRoamRecordTableColumn } from '../../../../constants/page-table-column'
import moment from 'moment'
import usePrompt from '@/hooks/usePrompt';
type PropsType = {
type: 'add' | 'edit';
......@@ -55,6 +55,7 @@ const getConst = (len = 0) => {
const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id, planData, btnCode }) => {
const [form] = Form.useForm()
const { renderPrompt, handleLeave } = usePrompt()
const [historyData, setHistoryData] = useState<any>([])
const [tableDataSource, setTableDataSource] = useState<any[]>()
const [loading, setLoading] = useState<boolean>(false)
......@@ -201,6 +202,7 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
value={rcode['planCount']}
index={index}
keyup="planCount"
onValuesChange={() => { handleLeave() }}
/>
)
}
......@@ -226,7 +228,7 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
</AuthButton>
}
>
<Form labelAlign='left' form={form}>
<Form labelAlign='left' form={form} onValuesChange={() => { handleLeave() }}>
<BaseInfo className='mt-0' title={base_info.name} id={base_info.key}>
<Form.Item
{...formItemLayout}
......@@ -248,6 +250,7 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
]}
>
<RoleSelect
isDefault={!planData}
disabled={!!planData}
formatFeils={(e) => {
return {
......@@ -356,6 +359,7 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
)
}
</Form>
{renderPrompt()}
</AnchorPage>
)
}
......
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