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