Commit 0f85b9bb authored by leimo's avatar leimo

Merge branch '220418-fix' into 'v2-220418'

fix: 计划生成通知单商品名字段调整 See merge request linkseeks-design/pro-platform!504
parents f405837a 18742bd5
.progressBox {
display: inline-block;
margin-left: 8px;
display: flex;
align-items: center;
}
.progress {
......@@ -8,6 +8,7 @@
align-items: center;
width: 240px;
height: 16px;
margin-left: 8px;
padding: 0 8px;
border-radius: 8px;
font-size: 12px;
......
import { useState, useImperativeHandle, forwardRef, useRef } from 'react'
import { useState, useImperativeHandle, forwardRef, ReactNode } from 'react'
import { Modal, Input, Form, message, FormInstance } from 'antd'
import styles from './index.less'
......@@ -6,6 +6,10 @@ export type HandleType = {
render: (form: FormInstance<any>, otherValues?: Object) => void;
}
type PropsType = {
title?: string | ReactNode
}
type ColorItemType = { bg: string, text: string }
type ColorType = {
......@@ -32,7 +36,7 @@ const getColor = (scale: number) => {
}
}
const FormProgress = ({}, ref: any) => {
const FormProgress = ({ title }: PropsType, ref: any) => {
const [scale, setScale] = useState<number>(0)
useImperativeHandle(ref, () => ({
......@@ -58,6 +62,7 @@ const FormProgress = ({}, ref: any) => {
return (
<div className={styles.progressBox}>
{title}
<div
className={styles.progress}
style={{ backgroundColor: getColor(scale).bg, color: getColor(scale).text }}
......
......@@ -130,7 +130,7 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
roleType: 2
}
const receivingAddress = {
planNo: planData.planNo,
planNo: data.planNo,
provinceName: data.provinceName,
cityName: data.cityName,
districtName: data.districtName,
......@@ -179,7 +179,7 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
fullAddress: `${planData.provinceName || ''}${planData.cityName || ''}${planData.districtName || ''}${planData.streetName || ''}${planData.address || ''}`
}
form.setFieldsValue({
digest: `${planData.deliveryTime}${planData.productName || ''}送货通知`,
digest: `${planData.deliveryTime}${planData.products[0]?.productName || ''}送货通知`,
deliveryTime: moment(planData.deliveryTime),
receivingAddress,
member: {
......@@ -236,7 +236,7 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
return (
<AnchorPage
title={<div>{`${PAGE_TYPE_LABEL[type]}送货通知单`}<FormProgress ref={progressRef} /></div>}
title={<FormProgress title={`${PAGE_TYPE_LABEL[type]}送货通知单`} ref={progressRef} />}
onBack={() => history.goBack()}
anchors={getConst(tableDataSource?.length)}
extra={
......
......@@ -182,7 +182,7 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
fullAddress: `${planData.provinceName || ''}${planData.cityName || ''}${planData.districtName || ''}${planData.streetName || ''}${planData.address || ''}`
}
form.setFieldsValue({
digest: `${planData.deliveryTime}${planData.productName || ''}送货通知`,
digest: `${planData.deliveryTime}${planData.products[0]?.productName || ''}送货通知`,
deliveryTime: moment(planData.deliveryTime),
receivingAddress,
member: {
......@@ -239,7 +239,7 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
return (
<AnchorPage
title={<div>{`${PAGE_TYPE_LABEL[type]}送货通知单`}<FormProgress ref={progressRef} /></div>}
title={<FormProgress title={`${PAGE_TYPE_LABEL[type]}送货通知单`} ref={progressRef} />}
onBack={() => history.goBack()}
anchors={getConst(tableDataSource?.length)}
extra={
......
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