Commit a49715dd authored by 前端-彭佳文's avatar 前端-彭佳文

Merge branch 'v2-220418-order' into 'v2-220418'

V2 220418 order See merge request linkseeks-design/pro-platform!139
parents 310401bc 63fe498f
......@@ -27,7 +27,7 @@ import MaterialRoute from './materialRoute';
// import contracRoute from './contracRoute';
// export const routes = [CommodityRoute, MemberRoute, ShopRoute, ChannelRoute, TranactionRoute, AfterService, PayandSettleRoute, LogisticsRoute, AuthConfigRoute, HandlingRoute, BalaceRoute]
const isDev = false;
const isDev = process.env.NODE_ENV === "development";
const homeRoute = {
path: `/memberCenter/home`,
name: 'home',
......
......@@ -10,6 +10,7 @@ import {
interface RoleSelectProps {
request?: (payload: any) => Promise<any>
params?: object
onChange?: (e) => void
}
......@@ -20,7 +21,7 @@ interface RoleSelectProps {
*/
function RoleSelect(props: RoleSelectProps) {
const { onChange } = props
const { request, params, onChange } = props
const [visible, setVisible] = useState(false);
const [form] = Form.useForm()
......@@ -38,7 +39,10 @@ function RoleSelect(props: RoleSelectProps) {
useEffect(() => {
getMemberManageLowerConsumerMemberPage(form.getFieldsValue()).then(res => {
request({
...params,
...form.getFieldsValue()
}).then(res => {
setDataSource(res.data.data)
})
......@@ -48,7 +52,7 @@ function RoleSelect(props: RoleSelectProps) {
<>
<Row gutter={4}>
<Col span={18}>
<Input value={intV?.name} />
<Input value={intV?.name} disabled/>
</Col>
<Col span={6}>
<Button onClick={showDrawer}>选择采购会员</Button>
......@@ -75,16 +79,12 @@ function RoleSelect(props: RoleSelectProps) {
</Form>
<Radio.Group className="block w-full" onChange={(e) => {
const value = e.target.value
let target = {
buyerMemberId: value.memberId,
buyerRoleId: value.roleId,
roleType: 2
}
setIntV(target)
onChange(target)
setIntV(value)
onChange(value)
}}>
<Table
className="w-full"
rowKey={'id'}
columns={TableMemberColumn}
dataSource={dataSource}
/>
......@@ -94,5 +94,9 @@ function RoleSelect(props: RoleSelectProps) {
</>
);
}
RoleSelect.defaultProps = {
request: getMemberManageLowerConsumerMemberPage,
params: {},
onChange: (e) => {}
}
export default RoleSelect;
\ No newline at end of file
......@@ -51,7 +51,8 @@ export const ReceivingAddress = '收货地址';
export const SubmitDeliveryNotice = '提交送货通知单';
export const ConfirmDeliveryNotice = '确认送货通知单';
export const DeliveryPlanText = '送货计划'
export const DeliveryPlanRemark = '最长600个字符,300个汉字'
......
/**
* 订单能力 - 送货计划管理 - 待提交送货计划 B2B 详情
* @author: Gavin
* @description: 与SRM内容大致相同,文件分开方便后续对接以及日后变动修改二开
*/
import React, { useEffect, useRef, useState } from 'react'
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { history } from 'umi'
import { Circulation, ConfirmDeliveryPlan, Purchaser, SubmitDeliveryPlan, BaseInfo as base_Info, Supplier, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalState, Remarks, ExternalRoamRecord, PlannedDelivery } from '../../constants'
import { Button, Calendar, DatePicker, Form, Input, InputNumber, Modal, Space, Steps, Table } from 'antd'
import { SaveOutlined } from '@ant-design/icons'
import BaseInfo from '@/components/BaseInfo/BaseInfo'
import { ExternalRoamRecordTableColumn } from '../../constants/page-table-column'
import _ from 'lodash'
import { getDayAll, getDayAll2 } from '../../utils/date'
import { BrandColumn, ClassColumn, CommodityNoColumn, ConsigneeNumColumn, DeliveredNumColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OredrNumColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn } from '../../constants/table-column'
import { RoleSelect } from '@/components/RoleSelect'
import { getMemberManageLowerMerchantProviderPage } from '@/services/MemberV2Api'
import { getOrderDeliveryPlanOrderProductPage } from '@/services/OrderNewV2Api'
const formItemLayout = {
labelCol: { span: 3 },
wrapperCol: { span: 18 }
}
// 1:查询供应商角色,2:查询采购商角色
const ROLE_TYPE = '1'
// 1:b2b,2:srm
const OEDER_TYPE = '2'
const testObj = {
"2022-04-01": 0,
"2022-04-02": 1,
"2022-04-03": 2,
"2022-04-04": 3,
"2022-04-05": 4,
"2022-04-06": 5,
"2022-04-07": 6,
"2022-04-08": 7,
"2022-04-09": 8,
"2022-04-10": 9,
"2022-04-11": 10,
"2022-04-12": 11,
"2022-04-13": 12,
"2022-04-14": 13,
"2022-04-15": 14,
"2022-04-16": 15
}
const DeliveryPlanAwaitB2BDetails: React.FC = () => {
const [form] = Form.useForm()
// 锚点标题
const [iAnchors, setiAnchors] = useState<AnchorsItem[]>([
Circulation,
base_Info,
PlannedDelivery,
Remarks,
ExternalRoamRecord,
])
// 动态 TableColumn
const [goodsTableColumn, setGoodsTableColumn] = useState<any>([
{ ...CommodityNoColumn, dataIndex: 'skuId', width: 80, },
{ ...TradeNameColumn, dataIndex: 'productName', width: 192, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
{ ...OredrNumColumn, dataIndex: 'purchaseCountSum', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, },
])
// 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>([
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 400, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 160, },
{ ...OredrNumColumn, dataIndex: 'purchaseCount', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 128, },
])
const expandedRowRender = (record, index) => {
return <Table rowKey={'id'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" />
}
// 选中 开始时间,结束时间
const [selectedDate, setSelectedDate] = useState<Array<string>>([])
// 选中 会员信息
const [selectedMember, setSelectedMember] = useState<any>({})
// 计划摘要
const [planSummaryText, setPlanSummaryText] = useState<string>(null)
const [goodsTableData, setGoodsTableData] = useState<any>(null)
const [details, setDetails] = useState<any>({})
// 保存
const save = () => {
form.validateFields().then(values => {
console.log('values :>> ', values)
})
}
// 根据选择日期动态添加 tableColumn
const handleDateAssembleColumn = (dates) => {
if (_.isArray(dates)) {
const startDate = dates[0].format('YYYY-MM-DD')
const endDate = dates[1].format('YYYY-MM-DD')
const datas = getDayAll(startDate, endDate)
const datesColumn = datas.map((item, i) => ({ title: item, dataIndex: 'date' + i, width: 120, align: 'center', }))
const datesExpandIconColumn = datas.map((item, i) => ({
title: item,
dataIndex: 'date' + i,
width: 80,
align: 'center',
render: (text: string, record: any) => (<InputNumber bordered />)
}))
setSelectedDate([startDate, endDate])
setGoodsTableColumn([...goodsTableColumn, ...datesColumn])
setExpandIconColumn([...expandIconColumn, ...datesExpandIconColumn])
const dates2 = getDayAll2(startDate, endDate)
// dates2.map(item => ({ [item]: 0}))
let obj = {}
for(let i = 0; i < dates2.length; i ++) {
obj[dates2[i]] = i
console.log('999 :>> ', i)
}
console.log('obj :>> ', obj)
} else {
// 清空组装
console.log(' 需要清空组装 -------:>> ',)
}
}
// 选中的会员信息
const handleMemberInfo = (info) => {
console.log('info :>> ', info)
setSelectedMember(info)
}
// 获取计划送货
const getPlannedDelivery = () => {
getOrderDeliveryPlanOrderProductPage({
startDate: selectedDate[0],
endDate: selectedDate[1],
memberId: selectedMember.memberId,
roleId: selectedMember.roleId,
roleType: ROLE_TYPE,
orderType: OEDER_TYPE,
current: '1',
pageSize: '10'
}).then((res) => {
if (res.code === 1000) {
setGoodsTableData(res.data.data)
}
})
}
// 监听 选择日期 and 选择会员
useEffect(() => {
// 双条件满足 请求 获取计划送货
if (!_.isEmpty(selectedDate) && !_.isEmpty(selectedMember)) {
console.log('订单能力 - 送货计划管理 - 待提交送货计划 B2B -----------:>> ', '双条件满足 请求 获取计划送货')
getPlannedDelivery()
} else {
console.log('订单能力 - 送货计划管理 - 待提交送货计划 B2B -----------:>> ', '条件暂未满足不调取接口获取')
}
}, [selectedDate, selectedMember])
const getListData = (value) => {
console.log('getListData -> value :>> ', value.date())
}
const dateCellRender = (value) => {
const listData = getListData(value)
console.log('listData :>> ', value.format('YYYY-MM-DD'), listData)
const date = value.format('YYYY-MM-DD')
return (<>
{
testObj[date]
? <p>计划送货量: { testObj[date] }</p>
: null
}
</>)
}
const monthCellRender = (value) => {
console.log('monthCellRender -> value :>> ', value)
return (null)
}
return (<>
<AnchorPage
title={details?.name || '没有title'}
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
<Space>
<Button>保存并提交</Button>
<Button type='primary' icon={<SaveOutlined />} onClick={save}>保存</Button>
</Space>
}
>
<Form
labelAlign='left'
form={form}
>
<BaseInfo className='mt-0' title={Circulation.name} id={Circulation.key} cols={1}>
<Steps progressDot current={0}>
<Steps.Step title={Purchaser} description={SubmitDeliveryPlan} />
<Steps.Step title={Supplier} description={ConfirmDeliveryPlan} />
</Steps>
</BaseInfo>
<BaseInfo className='mt-16' title={base_Info.name} id={base_Info.key}>
<Form.Item
{...formItemLayout}
label={PlanningCycle}
name='dates'
>
<DatePicker.RangePicker style={{ width: '100%' }} onChange={(dates) => handleDateAssembleColumn(dates)} />
</Form.Item>
<Form.Item
{...formItemLayout}
label={SupplyMembersLabel}
name='memberId'
>
{/* 临时调用SRM会员列表 */}
<RoleSelect
request={getMemberManageLowerMerchantProviderPage}
onChange={handleMemberInfo}
params={{ current: '1', pageSize: '100' }}
/>
</Form.Item>
<Form.Item
{...formItemLayout}
label={PlanSummary}
name='planSummary'
>
<Input value={planSummaryText} onBlur={e => console.log('e :>> ', e)} />
</Form.Item>
<Form.Item
{...formItemLayout}
label={ExternalState}
>
待提交
</Form.Item>
</BaseInfo>
<BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}>
<Table
// defaultExpandAllRows
rowKey={'id'}
columns={goodsTableColumn}
expandedRowRender={expandedRowRender}
dataSource={goodsTableData}
tableLayout="fixed"
scroll={{ x: 2022 }}
/>
</BaseInfo>
<BaseInfo className='mt-16' title={Remarks.name} id={Remarks.key} cols={1}>
<Input.TextArea rows={4} maxLength={300} placeholder='最长600个字符,300个汉字。' />
</BaseInfo>
<BaseInfo className='mt-16' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<Table
rowKey={'id'}
dataSource={[{
id: '1',
'name1': '1',
'name2': '操作角色',
'name3': '状态',
'name4': '操作',
'name5': '操作时间',
'name6': '备注',
},]}
columns={ExternalRoamRecordTableColumn}
/>
</BaseInfo>
</Form>
</AnchorPage>
<Modal
title='测试'
visible={!true}
width={1200}
>
{/* dateCellRender={dateCellRender} monthCellRender={monthCellRender} */}
{/* headerRender={({value, onChange}) => {
return (<span>999</span>)
}} */}
<Calendar dateCellRender={dateCellRender} monthCellRender={monthCellRender} />
</Modal>
</>)
}
export default DeliveryPlanAwaitB2BDetails
\ No newline at end of file
......@@ -3,23 +3,36 @@
* @author: Gavin
* @description: 与SRM内容大致相同,文件分开方便后续对接以及日后变动修改二开
*/
import React, { useRef, useState } from 'react'
import React, { useEffect, useRef, useState } from 'react'
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import { history } from 'umi'
import { Circulation, ConfirmDeliveryPlan, Purchaser, SubmitDeliveryPlan, BaseInfo as base_Info, Supplier, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalState, Remarks, ExternalRoamRecord, PlannedDelivery } from '../../constants'
import { Button, DatePicker, Form, Input, Space, Steps, Table } from 'antd'
import { Circulation, ConfirmDeliveryPlan, Purchaser, SubmitDeliveryPlan, BaseInfo as base_Info, Supplier, PlanningCycle, SupplyMembersLabel, PlanSummary, ExternalState, Remarks, ExternalRoamRecord, PlannedDelivery, DeliveryPlanText, DeliveryPlanRemark } from '../../constants'
import { Button, DatePicker, Form, Input, InputNumber, Space, Steps, Table } from 'antd'
import { SaveOutlined } from '@ant-design/icons'
import BaseInfo from '@/components/BaseInfo/BaseInfo'
import { ExternalRoamRecordTableColumn } from '../../constants/page-table-column'
import _ from 'lodash'
import { getDayAll } from '../../utils/date'
import { BrandColumn, ClassColumn, CommodityNoColumn, ConsigneeNumColumn, DeliveredNumColumn, OredrNumColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn } from '../../constants/table-column'
import { convertArrtoObj, getDayAll } from '../../utils'
import { BrandColumn, ClassColumn, CommodityNoColumn, ConsigneeNumColumn, DeliveredNumColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OredrNumColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn } from '../../constants/table-column'
import { RoleSelect } from '@/components/RoleSelect'
import { getMemberManageLowerMerchantProviderPage } from '@/services/MemberV2Api'
import { getOrderDeliveryPlanOrderProductPage, postOrderDeliveryPlanB2bCreate } from '@/services/OrderNewV2Api'
const formItemLayout = {
labelCol: { span: 3 },
wrapperCol: { span: 18 }
}
// 1:查询供应商角色,2:查询采购商角色
const ROLE_TYPE = '1'
// 1:b2b,2:srm
const OEDER_TYPE = '1'
const DeliveryPlanAwaitB2BDetails: React.FC = () => {
const [form] = Form.useForm()
const datesRef = useRef<any>(null)
const goodsTableDataRef = useRef(null)
// 锚点标题
const [iAnchors, setiAnchors] = useState<AnchorsItem[]>([
Circulation,
base_Info,
......@@ -27,50 +40,170 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
Remarks,
ExternalRoamRecord,
])
// 动态 TableColumn
const [goodsTableColumn, setGoodsTableColumn] = useState<any>([
{ ...CommodityNoColumn, dataIndex: 'skuId', width: 80, },
{ ...TradeNameColumn, dataIndex: 'productName', width: 192, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
{ ...OredrNumColumn, dataIndex: 'purchaseCountSum', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCountSum', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCountSum', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCountSum', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCountSum', width: 128, },
])
// 动态 expandIconColumn
const [expandIconColumn, setExpandIconColumn] = useState<any>([
{ ...OrderNoColumn, dataIndex: 'orderNo', width: 80, },
{ ...OrderSummaryColumn, dataIndex: 'orderDigest', width: 200, },
{ ...OrderCreatedAtColumn, dataIndex: 'createTime', width: 160, },
{ ...OredrNumColumn, dataIndex: 'purchaseCount', width: 96, },
{ ...ConsigneeNumColumn, dataIndex: 'receiveCount', width: 96, },
{ ...TransitNumColumn, dataIndex: 'transitCount', width: 96, },
{ ...DeliveredNumColumn, dataIndex: 'leftCount', width: 96, },
{ ...PlannedDeliveryNumColumn, dataIndex: 'planCount', width: 128, },
])
const [form] = Form.useForm()
const expandedRowRender = (record, index) => {
return <Table rowKey={'orderProductId'} columns={expandIconColumn} dataSource={record.orders} pagination={false} tableLayout="fixed" />
}
// 选中 开始时间,结束时间
const [selectedDate, setSelectedDate] = useState<Array<string>>([])
// 选中 会员信息
const [selectedMember, setSelectedMember] = useState<any>({})
//
const [goodsTableData, setGoodsTableData] = useState<any>(null)
const [details, setDetails] = useState<any>({})
// 保存
const save = () => {
form.validateFields().then(values => {
console.log('values :>> ', values)
const productList = goodsTableDataRef.current.map((item: any) => {
return {
...item,
orders: item.orders.map((o: any) => {
const planDays = Object.keys(o).filter((f: any) => f.startsWith('$')).map((p: any) => o[p])
return {
...o,
planDays
}
})
}
})
postOrderDeliveryPlanB2bCreate({
vendorMemberId: selectedMember.memberId,
vendorRoleId: selectedMember.roleId,
vendorMemberName: selectedMember.name,
digest: values.planSummaryText,
planStartTime: values.dates[0].format('YYYY-MM-DD'),
planEndTime: values.dates[1].format('YYYY-MM-DD'),
remark: values.remark,
productList
}).then((res: any) => {
console.log('保存 :>> ', res)
})
})
}
const getDateAssembleColumn = (dates) => {
// console.log(_.isArray(dates))
if (_.isArray(dates)) {
const startDate = dates[0].format('YYYY-MM-DD')
const endDate = dates[1].format('YYYY-MM-DD')
const datas = getDayAll(startDate, endDate)
const datesColumn = datas.map((item, i) => ({ title: item, dataIndex: 'date' + i, width: '80px', align: 'center' }))
console.log('allDates :>> ', getDayAll(startDate, endDate))
console.log('datesColumn :>> ', datesColumn)
// 对应日期填入的送货数量
const inputChange = (val: any, text: any, record: any) => {
let { day } = text
let dataArr = JSON.parse(JSON.stringify(goodsTableDataRef.current))
let index = dataArr.findIndex(f => f.skuId === record.skuId)
let childIndex = dataArr[index].orders.findIndex(f => f.orderProductId === record.orderProductId)
dataArr[index].orders[childIndex][`$${day}`].planCount = val
// console.log('goodsTableDataRef.current 2222:>> ', goodsTableDataRef.current)
goodsTableDataRef.current = dataArr
setGoodsTableData(dataArr)
}
// 计划周期 选择日期
const handleDateAssembleColumn = (dateGroup) => {
if (_.isArray(dateGroup)) {
const startDate = dateGroup[0].format('YYYY-MM-DD')
const endDate = dateGroup[1].format('YYYY-MM-DD')
const dates = getDayAll(startDate, endDate)
datesRef.current = dates
setSelectedDate([startDate, endDate])
const datesColumn = dates.map((item, i) => ({ title: item.substr(2), dataIndex: item, key: item, width: 120, align: 'center', }))
const datesExpandIconColumn = dates.map((item, i) => ({
title: item.substr(2),
dataIndex: item,
key: item,
width: 80,
align: 'center',
render: (text: any, record: any) => (<InputNumber style={{ width: '100%' }} bordered value={text?.planCount} onChange={(val) => inputChange(val, text, record)} />)
}))
setGoodsTableColumn([...goodsTableColumn, ...datesColumn])
setExpandIconColumn([...expandIconColumn, ...datesExpandIconColumn])
} else {
// 清空组装
// 清空
datesRef.current = null
goodsTableDataRef.current = null
setSelectedDate([])
setGoodsTableData([])
}
}
return (
// 选中的会员信息
const handleMemberInfo = (info) => {
console.log('info :>> ', info)
setSelectedMember(info)
}
// 获取计划送货
const getPlannedDelivery = () => {
getOrderDeliveryPlanOrderProductPage({
startDate: selectedDate[0],
endDate: selectedDate[1],
memberId: selectedMember.memberId,
roleId: selectedMember.roleId,
roleType: ROLE_TYPE,
orderType: OEDER_TYPE,
current: '1',
pageSize: '10'
}).then((res) => {
if (res.code === 1000) {
const assemble = res.data.data.map((item => {
return {
...item,
...convertArrtoObj(datesRef.current),
orders: item.orders.map(o => ({ ...o, ...convertArrtoObj(datesRef.current), }))
}
}))
console.log('assemble ------------- :>> ', assemble)
goodsTableDataRef.current = assemble
setGoodsTableData(assemble)
}
})
}
// 监听 选择日期 and 选择会员
useEffect(() => {
// 双条件满足 请求
if (!_.isEmpty(selectedDate) && !_.isEmpty(selectedMember)) {
console.log('订单能力 - 送货计划管理 - 待提交送货计划 B2B -----------:>> ', '双条件满足 请求 获取计划送货')
getPlannedDelivery()
const planSummaryText = `${selectedDate[0]}~${selectedDate[1]} ${selectedMember.name} ${DeliveryPlanText}`
form.setFieldsValue({ planSummaryText })
} else {
console.log('订单能力 - 送货计划管理 - 待提交送货计划 B2B -----------:>> ', '条件暂未满足不调取接口获取')
}
}, [selectedDate, selectedMember])
return (<>
<AnchorPage
title={details?.name || '没有title'}
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
<Space>
<Button>保存并新增</Button>
<Button>保存并提交</Button>
<Button type='primary' icon={<SaveOutlined />} onClick={save}>保存</Button>
</Space>
}
......@@ -91,7 +224,7 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
label={PlanningCycle}
name='dates'
>
<DatePicker.RangePicker style={{ width: '100%' }} onChange={(dates) => getDateAssembleColumn(dates)} />
<DatePicker.RangePicker style={{ width: '100%' }} onChange={(dates) => handleDateAssembleColumn(dates)} />
</Form.Item>
<Form.Item
......@@ -99,13 +232,18 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
label={SupplyMembersLabel}
name='memberId'
>
<Input />
{/* 临时调用SRM会员列表 */}
<RoleSelect
request={getMemberManageLowerMerchantProviderPage}
onChange={handleMemberInfo}
params={{ current: '1', pageSize: '100' }}
/>
</Form.Item>
<Form.Item
{...formItemLayout}
label={PlanSummary}
name='planSummary'
name='planSummaryText'
>
<Input />
</Form.Item>
......@@ -120,16 +258,20 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
<BaseInfo className='mt-16' title={PlannedDelivery.name} id={PlannedDelivery.key} cols={1}>
<Table
// defaultExpandAllRows
rowKey={'id'}
rowKey={'skuId'}
columns={goodsTableColumn}
// expandable={{ expandedRowRender }}
dataSource={[{ id: 1 }]}
expandedRowRender={expandedRowRender}
dataSource={goodsTableData}
tableLayout="fixed"
scroll={{ x: 2022 }}
/>
</BaseInfo>
<BaseInfo className='mt-16' title={Remarks.name} id={Remarks.key} cols={1}>
<Input.TextArea rows={6} maxLength={300} placeholder='最长600个字符,300个汉字。' />
<Form.Item
name='remark'
>
<Input.TextArea rows={4} maxLength={300} placeholder={DeliveryPlanRemark} />
</Form.Item>
</BaseInfo>
<BaseInfo className='mt-16' title={ExternalRoamRecord.name} id={ExternalRoamRecord.key} cols={1}>
<Table
......@@ -148,7 +290,7 @@ const DeliveryPlanAwaitB2BDetails: React.FC = () => {
</BaseInfo>
</Form>
</AnchorPage>
)
</>)
}
export default DeliveryPlanAwaitB2BDetails
\ No newline at end of file
// 公共组装类工具
/**
* 数组转对象 默认赋值 0 (示例:['$04-01','$04-02'] = { '$04-01': {}, '$04-02': {} })
* @param arr
* @returns
*/
const convertArrtoObj = (arr) => {
return arr.reduce((obj,currVal) => {
return{
...obj,
[currVal]: { day: currVal.substr(1), planCount: 0, createNotice: false, createDelivery: false }
}
}, {})
}
export {
convertArrtoObj
}
\ No newline at end of file
// 公共日期类工具
const getDayAll = (starDay: string, endDay: string) => {
let arr = []
let dates = []
......@@ -24,13 +26,46 @@ const getDayAll = (starDay: string, endDay: string) => {
let day = time.getDate() >= 10 ? time.getDate() : '0' + time.getDate()
// year + '-' +
// let YYMMDD = year + '-' + mouth + '-' + day
let MMDD = mouth + '-' + day
let MMDD = '$' + mouth + '-' + day
dates.push(MMDD)
}
// dates.pop()
return dates
}
// deliveryPlanManagement - deliveryPlanAwaitB2B - details copy.ts 测试使用,上线前需要删除
const getDayAll2 = (starDay: string, endDay: string) => {
let arr = []
let dates = []
// 设置两个日期UTC时间
let db = new Date(starDay)
let de = new Date(endDay)
// 获取两个日期GTM时间
let s = db.getTime() - 24 * 60 * 60 * 1000
let d = de.getTime() - 24 * 60 * 60 * 1000
// 获取到两个日期之间的每一天的毫秒数
for (let i = s; i <= d; ) {
i = i + 24 * 60 * 60 * 1000
arr.push(parseInt(String(i)))
}
// 获取每一天的时间 YY-MM-DD
for (let j in arr) {
let time = new Date(arr[j])
let year = time.getFullYear()
let mouth = time.getMonth() + 1 >= 10 ? time.getMonth() + 1 : '0' + (time.getMonth() + 1)
let day = time.getDate() >= 10 ? time.getDate() : '0' + time.getDate()
// year + '-' +
let YYMMDD = year + '-' + mouth + '-' + day
dates.push(YYMMDD)
}
dates.pop()
return dates
}
export {
getDayAll
getDayAll,
getDayAll2,
}
\ No newline at end of file
export * from './status'
\ No newline at end of file
export * from './status'
export * from './date'
export * from './assemblyTools'
\ No newline at end of file
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