Commit 076490bc authored by 前端-李俊鑫's avatar 前端-李俊鑫

fix: 计划生成需求单调整

parent ab867c27
......@@ -13,15 +13,16 @@ export const HarvestMaterialContextProvider = HarvestMaterialContext.Provider
export const HarvestMaterialContextConsumer = HarvestMaterialContext.Consumer
/**
*
*
* @param props Table修个的时候,需要参数
* @returns
* @returns
*/
export function HarvestMaterialInput(props: {
value: any, //input 显示的值
index: number // table 当前的 index下标
keyUp: string // dataSource 对应的row key
min?: number
disabled?: boolean
}) {
const context = useContext(HarvestMaterialContext);
......@@ -35,7 +36,7 @@ export function HarvestMaterialInput(props: {
saveValue(targetVal)
return;
}
// 存在小数点 且 字符串必须大于 . +1 才执行
// 存在小数点 且 字符串必须大于 . +1 才执行
if (targetVal.includes('.') && targetVal.length != targetVal.indexOf('.')) {
const reg = new RegExp("((^[1-9][0-9]{0,8})+(.?[0-9]{1,3})?$)")
const test = reg.test(targetVal)
......@@ -81,4 +82,4 @@ export function HarvestMaterialDelete(props: {
return (
<Button onClick={handleClick} type="link">删除</Button>
)
}
\ No newline at end of file
}
......@@ -25,6 +25,7 @@ type PropsType = {
type: 'add' | 'edit';
id?: string;
planData?: any;
btnCode: string;
}
enum PAGE_TYPE {
......@@ -42,7 +43,7 @@ const formItemLayout = {
wrapperCol: { span: 18 }
}
const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id, planData }) => {
const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id, planData, btnCode }) => {
const [form] = Form.useForm()
const [iAnchors, setiAnchors] = useState<AnchorsItem[]>([
Circulation,
......@@ -149,20 +150,19 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
} else {
// 通过送货计划生成时
if (planData) {
const firstProduct = planData.products?.[0] || {}
const receivingAddress = {
provinceName: firstProduct.provinceName,
cityName: firstProduct.cityName,
districtName: firstProduct.districtName,
streetName: firstProduct.streetName,
address: firstProduct.address,
phone: firstProduct.phone,
consignee: firstProduct.consignee,
consigneeId: firstProduct.consigneeId,
fullAddress: `${firstProduct.provinceName || ''}${firstProduct.cityName || ''}${firstProduct.districtName || ''}${firstProduct.streetName || ''}${firstProduct.address || ''}`
provinceName: planData.provinceName,
cityName: planData.cityName,
districtName: planData.districtName,
streetName: planData.streetName,
address: planData.address,
phone: planData.phone,
consignee: planData.consignee,
consigneeId: planData.consigneeId,
fullAddress: `${planData.provinceName || ''}${planData.cityName || ''}${planData.districtName || ''}${planData.streetName || ''}${planData.address || ''}`
}
form.setFieldsValue({
digest: `${planData.deliveryTime}${firstProduct.productName || ''}送货通知`,
digest: `${planData.deliveryTime}${planData.productName || ''}送货通知`,
deliveryTime: moment(planData.deliveryTime),
receivingAddress,
member: {
......@@ -218,7 +218,7 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
<AuthButton btnCode='' menuCode=''>
<AuthButton btnCode={btnCode}>
<Button loading={loading} onClick={handleSubmit} type='primary'>提交</Button>
</AuthButton>
}
......@@ -294,6 +294,7 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
{...formItemLayout}
label={DeliveryTime}
name='deliveryStartEndTime'
initialValue={[moment('08:00', 'HH:mm'), moment('12:00', 'HH:mm')]}
rules={[
{ required: true, message: `请选择${DeliveryTime}` }
]}
......
......@@ -26,6 +26,7 @@ type PropsType = {
type: 'add' | 'edit';
id?: string;
planData?: any;
btnCode: string;
}
enum PAGE_TYPE {
......@@ -43,7 +44,7 @@ const formItemLayout = {
wrapperCol: { span: 18 }
}
const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id, planData }) => {
const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id, planData, btnCode }) => {
const [form] = Form.useForm()
const [iAnchors, setiAnchors] = useState<AnchorsItem[]>([
Circulation,
......@@ -150,20 +151,19 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
} else {
// 通过送货计划生成时
if (planData) {
const firstProduct = planData.products?.[0] || {}
const receivingAddress = {
provinceName: firstProduct.provinceName,
cityName: firstProduct.cityName,
districtName: firstProduct.districtName,
streetName: firstProduct.streetName,
address: firstProduct.address,
phone: firstProduct.phone,
consignee: firstProduct.consignee,
consigneeId: firstProduct.consigneeId,
fullAddress: `${firstProduct.provinceName || ''}${firstProduct.cityName || ''}${firstProduct.districtName || ''}${firstProduct.streetName || ''}${firstProduct.address || ''}`
provinceName: planData.provinceName,
cityName: planData.cityName,
districtName: planData.districtName,
streetName: planData.streetName,
address: planData.address,
phone: planData.phone,
consignee: planData.consignee,
consigneeId: planData.consigneeId,
fullAddress: `${planData.provinceName || ''}${planData.cityName || ''}${planData.districtName || ''}${planData.streetName || ''}${planData.address || ''}`
}
form.setFieldsValue({
digest: `${planData.deliveryTime}${firstProduct.productName || ''}送货通知`,
digest: `${planData.deliveryTime}${planData.productName || ''}送货通知`,
deliveryTime: moment(planData.deliveryTime),
receivingAddress,
member: {
......@@ -219,7 +219,7 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
<AuthButton btnCode='' menuCode=''>
<AuthButton btnCode={btnCode}>
<Button loading={loading} onClick={handleSubmit} type='primary'>提交</Button>
</AuthButton>
}
......
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