Commit 28c0ace3 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 933b48cb 901b34cc
......@@ -201,6 +201,13 @@ const LogisticsRoute: RouterChild = {
component: '@/pages/logistics/components/orderSearchDetail',
hideInMenu: true
},
// 待确认物流单-详情
{
path: '/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/option',
name: 'orderResultDeatil',
component: '@/pages/logistics/components/orderSearchDetail',
hideInMenu: true
},
]
}
]
......
......@@ -9,7 +9,7 @@ export const productModalByMemberSchema: ISchema = {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
placeholder: '请输入商品名称/ID',
placeholder: '请输入商品名称',
align: 'flex-left',
},
},
......
export const NOT_CHANGE_VALUE = 'hello, world'
// socket的链接地址, 默认会使用后端接口网关地址
export const SOCKET_URL = process.env.SOCKET_URL || process.env.BACK_GATEWAY || "ws://10.0.0.25:9400"
export const SOCKET_URL = process.env.SOCKET_URL || process.env.BACK_GATEWAY.replace('http', 'ws') || "ws://10.0.0.25:9400"
export const MALL_TYPE = {
1: '企业商城',
......
......@@ -13,6 +13,7 @@ export interface Params {
dialogVisible: boolean;
onCancel: Function;
onOK?: Function;
freightPrice?: any;
dontReceive?: boolean; //默认展示
}
const actions = createFormActions()
......@@ -24,7 +25,9 @@ const comfirmDialog: React.FC<Params> = (props) => {
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
console.log(values)
if(props.freightPrice) {
value.freightPrice = props.freightPrice
}
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if (res.code === 1000) {
props.onOK()
......@@ -81,19 +84,6 @@ const comfirmDialog: React.FC<Params> = (props) => {
status: 4
}}
>
{props.dontReceive &&
<>
<Field
title='运费'
name='freightPrice'
x-component="numberpicker"
x-mega-prop={{
wrapperWidth: 300,
labelAlign: 'left'
}}
/>
</>
}
<Field
enum={
[
......
......@@ -254,7 +254,7 @@ const detailInfo: React.FC<{}> = () => {
//待确认物流单
if (pathname === '/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/detail') {
PublicApi.getLogisticsOrderWaitConfirmGet({ id: id }).then(res => {
setdataInfo(res.data)
let current = 0
......@@ -288,6 +288,15 @@ const detailInfo: React.FC<{}> = () => {
history.goBack()
}
// 获取路由link
const { pathname } = history.location;
const type = pathname.split('/')[pathname.split('/').length - 1];
const [freightPrice, setfreightPrice] = useState<any>(null);
// 输入报价价格
const inputOnchange = (e: any) => {
const value = e.target.value;
setfreightPrice(value);
}
return (
<PageHeaderWrapper
......@@ -303,19 +312,15 @@ const detailInfo: React.FC<{}> = () => {
</div>
</>
}
// extra={
// dataInfo.status === 2 &&
// <>
// <Button onClick={() => setvisible(true)}>
// <StopOutlined />
// 不接受物流单
// </Button>
// <Button onClick={() => setvisible(true)} className={style['saveBtn']}>
// <CheckSquareOutlined />
// 接受物流单
// </Button>
// </>
// }
extra={
type === 'option' &&
<>
<Button onClick={() => setvisible(true)} className={style['saveBtn']}>
<CheckSquareOutlined />
确认物流单
</Button>
</>
}
content={
<div className={style['headerMain']}>
<div className={style['headerMain-left']}>
......@@ -410,7 +415,7 @@ const detailInfo: React.FC<{}> = () => {
{infoTem['base'].rightElem.map(
(item: any, index: number) => {
return (
<div className={style['cols-main']} key={index}>
<div className={style['cols-main']} key={`base${index + 1}`}>
<div className={style['cols-main-options']}>
{item.title}
</div>
......@@ -421,22 +426,7 @@ const detailInfo: React.FC<{}> = () => {
},
)}
</div>
</div>
{/* <div className={style['mainCol-row']}>
{infoTem['base'].elem.map((item: any, index: number) => {
return (
<div className={style['mainCol-row-col']} key={index}>
<div className={style['mainCol-row-col-option']}>
{item.title}
</div>
<div className={style['mainCol-row-col-option']}>
185 2929 6547
</div>
</div>
);
})}
</div> */}
</Col>
<Col className={style['mainCol']} span={24}>
<div className={style['mainCol-title']}>
......@@ -473,16 +463,27 @@ const detailInfo: React.FC<{}> = () => {
{infoTem['freight'].leftElem.map(
(item: any, index: number) => {
return (
<div className={style['cols-main']} key={index}>
<div className={style['cols-main']} key={`freight${index + 1}`}>
<div className={style['cols-main-options']}>
{item.title}
</div>
{
item.key === 'freight' ?
<div className={style['cols-main-options']}>
{dataInfo.status < 3 ? '未报价' : item.value}
</div>
<>
{type === 'option' ?
<Input
addonBefore="¥"
onBlur={inputOnchange}
type='number'
maxLength={25}
style={{width: '300px'}}
/>
:
<div className={style['cols-main-options']}>
{dataInfo.status < 3 ? '未报价' : item.value}
</div>
}
</>
: <div className={style['cols-main-options']}>
{item.value}
</div>
......@@ -501,19 +502,12 @@ const detailInfo: React.FC<{}> = () => {
外部流转记录
</div>
<OrderLog id={id} pathName={history.location.pathname} />
{/* <StandardTable
tableProps={{rowKey:'id'}}
currentRef={ref}
columns={columns}
fetchTableData={(params: any) => fetchData(params)}
/> */}
</Col>
</Row>
<ConfirmModal
id={id}
dialogVisible={visible}
freightPrice={freightPrice}
onCancel={() => setvisible(false)}
onOK={() => handleModalOK()}
/>
......
......@@ -158,7 +158,7 @@ const OrderList: React.FC<ListProps> = (props) => {
align: 'center',
key: 'logisticsOrderNo',
render: (text: any, reconds: any) =>
<span className="commonPickColor" onClick={() => handleSee(reconds.id)}>{text}&nbsp;<EyeOutlined /></span>
<span className="commonPickColor" onClick={() => handleSee(false ,reconds.id)}>{text}&nbsp;<EyeOutlined /></span>
},
{
title: '对应订单号',
......@@ -232,7 +232,7 @@ const OrderList: React.FC<ListProps> = (props) => {
render: (_: any, record: any) => {
return (
<>
<Button type='link' onClick={() => handleDialog(record.id)}>确认</Button>
<Button type='link' onClick={() => handleSee(true, record.id)}>确认</Button>
</>
)
}
......@@ -271,8 +271,12 @@ const OrderList: React.FC<ListProps> = (props) => {
const handleDelete = () => {
console.log('delete')
}
const handleSee = (id: any) => {
history.push(`/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/detail?id=${id}`)
const handleSee = (option: boolean ,id: any) => {
if(option) {
history.push(`/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/option?id=${id}`)
}else {
history.push(`/memberCenter/logisticsAbility/logisticsResult/toOrderComfirmList/detail?id=${id}`)
}
}
const confirm = () => {
......
......@@ -42,12 +42,12 @@ interface imgItemType {
const integralPayWay = [
{
payType: 5,
payType: 0,
payVal: "积分支付",
payList: [
{
id: 8,
payType: 5,
id: 0,
payType: 0,
way: "积分支付"
}
]
......
......@@ -17,7 +17,7 @@ import SignModal from '@/components/SignModal'
import { isEmpty } from 'lodash'
import { GlobalConfig } from '@/global/config'
import { getAuth } from '@/utils/auth'
import { LAYOUT_TYPE, OrderModalType, COMMODITY_TYPE } from '@/constants'
import { LAYOUT_TYPE, OrderModalType, COMMODITY_TYPE, ORDER_TYPE2_POINTS, ORDER_TYPE2_CHANNEL_POINTS } from '@/constants'
interface OrderPropsType {
location: any;
......@@ -232,13 +232,25 @@ const Order: React.FC<OrderPropsType> = (props) => {
let mode = OrderModalType.PURCHASE_ORDER
switch (layoutType) {
case LAYOUT_TYPE.channel:
mode = OrderModalType.CHANNEL_DIRECT_PURCHASE_ORDER
if (Number(type) === COMMODITY_TYPE.integral) {
mode = 25
} else {
mode = OrderModalType.CHANNEL_DIRECT_PURCHASE_ORDER
}
break
case LAYOUT_TYPE.ichannel:
mode = OrderModalType.CHANNEL_SPOT_PURCHASE_ORDER
if (Number(type) === COMMODITY_TYPE.integral) {
mode = 25
} else {
mode = OrderModalType.CHANNEL_SPOT_PURCHASE_ORDER
}
break
default:
mode = OrderModalType.PURCHASE_ORDER
if (Number(type) === COMMODITY_TYPE.integral) {
mode = 24
} else {
mode = OrderModalType.PURCHASE_ORDER
}
break
}
return mode
......
......@@ -94,19 +94,3 @@
color: #909399;
}
}
.pay_btn {
width: 160px;
height: 50px;
color: #ffffff;
text-align: center;
line-height: 50px;
background-color: #D32F2F;
cursor: pointer;
margin-top: 20px;
&:hover {
opacity: .9;
}
}
\ No newline at end of file
import React, { useState } from 'react'
import React, { useState, useEffect } from 'react'
import cx from 'classnames'
import { LAYOUT_TYPE } from '@/constants'
import PasswordInput from '../passwordInput'
import { Button, message, Spin } from 'antd'
import { history } from 'umi'
import { GetOrderOrderPayDetailsResponse } from '@/services/OrderApi'
import { GetPayAssetAccountGetUserBalanceResponse } from "@/services/PayApi";
import { GetMemberSecurityGetResponse } from '@/services/MemberApi'
import { priceFormat } from '@/utils/numberFomat'
import { PublicApi } from '@/services/api'
import { linkToUrl } from '../../utils'
import styles from './index.less'
interface BablancePayWayPropsType {
payInfo: GetOrderOrderPayDetailsResponse,
orderInfo: any,
orderId: number,
onChange: Function,
layoutType?: LAYOUT_TYPE,
shopUrlParam?: string
}
const BablancePayWay: React.FC<BablancePayWayPropsType> = () => {
const BablancePayWay: React.FC<BablancePayWayPropsType> = (props) => {
const { payInfo, orderId, orderInfo, layoutType, shopUrlParam } = props
const [balanceInfo, setBalanceInfo] = useState<GetPayAssetAccountGetUserBalanceResponse>(0)
const [securityInfo, setSecurityInfo] = useState<GetMemberSecurityGetResponse>()
const [payPassword, setPayPassword] = useState<string>('')
const [type, setType] = useState<string>('normal') // normal: 普通;member:会员
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [pageLoading, setPageLoading] = useState<boolean>(true)
const [payDisabled, setPayDisabled] = useState<boolean>(false)
const handlePasswordChange = (value: string) => {
setPayPassword(value)
}
useEffect(() => {
if (orderInfo) {
fetchBalanceInfo()
fetchSecurity()
}
}, [orderInfo])
const fetchBalanceInfo = () => {
let param = {
parentMemberId: orderInfo.supplyMembersId,
parentMemberRoleId: orderInfo.supplyMembersRoleId
}
PublicApi.getPayAssetAccountGetUserBalance(param).then(res => {
if (res.code === 1000) {
setBalanceInfo(res.data)
setPageLoading(false)
}
})
}
const fetchSecurity = () => {
PublicApi.getMemberSecurityGet().then(res => {
if (res.code === 1000) {
setSecurityInfo(res.data)
}
})
}
const pay = () => {
if(balanceInfo < payInfo.payPrice) {
message.info("账户余额不足")
return
}
if (!payPassword || payPassword.length < 6) {
message.info("请输入支付密码")
return
}
let param = {
id: Number(orderId),
paymentInformationId: Number(payInfo.paymentInformationId),
payTypeId: payInfo.paymentChannelsId,
payPassword: Number(payPassword)
}
setConfirmLoading(true)
//@ts-ignore
PublicApi.postOrderPendingOrderPay(param).then(res => {
if (res.code === 1000) {
message.destroy()
message.success("支付成功")
linkToUrl(`/pay/result?orderId=${orderId}`, layoutType, shopUrlParam)
} else {
setConfirmLoading(false)
message.destroy()
message.error(res.message)
}
}).catch(() => {
setConfirmLoading(false)
})
}
return (
<>
<Spin spinning={pageLoading}>
<div className={styles.common_title}>
<span>余额支付</span>
<div className={styles.common_title_amount}>
<label>当前需支付:</label>
<span>20,000</span>
<span>{priceFormat(payInfo?.payPrice)}</span>
<label>RMB</label>
</div>
</div>
......@@ -31,25 +113,34 @@ const BablancePayWay: React.FC<BablancePayWayPropsType> = () => {
<div className={styles.pay_point_way_list_item_title}>账户可用余额</div>
<div className={styles.pay_point_way_list_item_content}>
<div className={styles.pay_point_way_list_item_point}>
<label>30,000</label>
<label>{balanceInfo}</label>
<span>RMB</span>
</div>
<div className={styles.pay_point_way_list_item_split}></div>
<div className={styles.pay_point_way_list_item_needpay}>
<label>当前需支付:</label>
<span>20,000</span>
<span>{priceFormat(payInfo?.payPrice)}</span>
<label>RMB</label>
</div>
</div>
</div>
</div>
</div>
<div className={styles.pay_wray}>
<div className={styles.pay_wray_title}>请输入支付密码</div>
<PasswordInput value={payPassword} onChange={handlePasswordChange} />
<div className={styles.pay_btn}>立即支付</div>
</div>
</>
{
securityInfo && securityInfo.hasPayPassword === 1 ? (
<div className={styles.pay_wray}>
<div className={styles.pay_wray_title}>请输入支付密码</div>
<PasswordInput value={payPassword} onChange={handlePasswordChange} />
<Button loading={confirmLoading} className={styles.pay_btn} onClick={() => pay()}>立即支付</Button>
</div>
) : (
<div className={styles.pay_wray}>
<div className={styles.pay_wray_title}>您还没有设置支付密码</div>
<Button loading={confirmLoading} disabled={payDisabled} className={styles.pay_btn} onClick={() => history.push(`/memberCenter/systemSetting/accountSetting/paycode?backPay=true`)} >去设置密码</Button>
</div>
)
}
</Spin>
)
}
......
......@@ -76,19 +76,3 @@
color: #909399;
}
}
.pay_btn {
width: 160px;
height: 50px;
color: #ffffff;
text-align: center;
line-height: 50px;
background-color: #D32F2F;
cursor: pointer;
margin-top: 20px;
&:hover {
opacity: .9;
}
}
\ No newline at end of file
import React, { useState } from 'react'
import React, { useState, useEffect } from 'react'
import cx from 'classnames'
import PasswordInput from '../passwordInput'
import { LAYOUT_TYPE } from '@/constants'
import { history } from 'umi'
import { GetOrderOrderPayDetailsResponse } from '@/services/OrderApi'
import { GetMemberSecurityGetResponse } from '@/services/MemberApi'
import { Button, message } from 'antd'
import { numFormat } from '@/utils/numberFomat'
import { PublicApi } from '@/services/api'
import { linkToUrl } from '../../utils'
import styles from './index.less'
interface PointPayWayPropsType {
payInfo: GetOrderOrderPayDetailsResponse,
orderInfo: any,
orderId: number,
onChange: Function,
layoutType?: LAYOUT_TYPE,
shopUrlParam?: string
}
const PointPayWay: React.FC<PointPayWayPropsType> = () => {
const PointPayWay: React.FC<PointPayWayPropsType> = (props) => {
const { payInfo, orderId, orderInfo, layoutType, shopUrlParam } = props
const [securityInfo, setSecurityInfo] = useState<GetMemberSecurityGetResponse>()
const [payPassword, setPayPassword] = useState<string>('')
const [type, setType] = useState<string>('normal') // normal: 普通;member:会员
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [payDisabled, setPayDisabled] = useState<boolean>(false)
const handlePasswordChange = (value: string) => {
setPayPassword(value)
......@@ -19,13 +36,57 @@ const PointPayWay: React.FC<PointPayWayPropsType> = () => {
setType(type)
}
useEffect(() => {
if (orderInfo) {
fetchSecurity()
}
}, [orderInfo])
const fetchSecurity = () => {
PublicApi.getMemberSecurityGet().then(res => {
if (res.code === 1000) {
setSecurityInfo(res.data)
}
})
}
const pay = () => {
if (!payPassword || payPassword.length < 6) {
message.error("请输入支付密码")
return
}
let param = {
id: Number(orderId),
paymentInformationId: Number(payInfo.paymentInformationId),
payTypeId: payInfo.paymentChannelsId,
payPassword: Number(payPassword)
}
setConfirmLoading(true)
//@ts-ignore
PublicApi.postOrderPendingOrderPay(param).then(res => {
if (res.code === 1000) {
message.destroy()
message.success("支付成功")
linkToUrl(`/pay/result?orderId=${orderId}`, layoutType, shopUrlParam)
} else {
setConfirmLoading(false)
message.destroy()
message.error(res.message)
}
}).catch(() => {
setConfirmLoading(false)
})
}
return (
<>
<div className={styles.common_title}>
<span>积分支付</span>
<div className={styles.common_title_amount}>
<label>当前需支付:</label>
<span>20,000</span>
<span>{numFormat(payInfo?.payPrice)}</span>
<label>积分</label>
</div>
</div>
......@@ -53,11 +114,20 @@ const PointPayWay: React.FC<PointPayWayPropsType> = () => {
</div>
</div>
</div>
<div className={styles.pay_wray}>
<div className={styles.pay_wray_title}>请输入支付密码</div>
<PasswordInput value={payPassword} onChange={handlePasswordChange} />
<div className={styles.pay_btn}>立即支付</div>
</div>
{
securityInfo && securityInfo.hasPayPassword === 1 ? (
<div className={styles.pay_wray}>
<div className={styles.pay_wray_title}>请输入支付密码</div>
<PasswordInput value={payPassword} onChange={handlePasswordChange} />
<Button loading={confirmLoading} className={styles.pay_btn} onClick={() => pay()}>立即支付</Button>
</div>
) : (
<div className={styles.pay_wray}>
<div className={styles.pay_wray_title}>您还没有设置支付密码</div>
<Button loading={confirmLoading} disabled={payDisabled} className={styles.pay_btn} onClick={() => history.push(`/memberCenter/systemSetting/accountSetting/paycode?backPay=true`)} >去设置密码</Button>
</div>
)
}
</>
)
}
......
......@@ -15,11 +15,12 @@
&_imgbox {
padding: 20px;
width: 180px;
height: 180px;
border: 1px solid rgba(245, 245, 245, 1);
&>img {
width: 200px;
height: 200px;
}
}
......
......@@ -2,9 +2,10 @@ import React, { useEffect } from 'react'
import { GetOrderOrderPayDetailsResponse } from '@/services/OrderApi'
import { LAYOUT_TYPE } from '@/constants'
import wechatIcon from '@/assets/imgs/wechat_icon.png'
import wechatImg from '@/assets/imgs/wechat.png'
import { priceFormat } from '@/utils/numberFomat'
import { PublicApi } from '@/services/api'
import { message, Spin } from 'antd'
import QRCode from 'qrcode'
import styles from './index.less'
import { useState } from 'react'
......@@ -19,12 +20,23 @@ interface WechatPayWayPropsType {
const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
const { payInfo, orderId, onChange, orderInfo, layoutType, shopUrlParam } = props
const [wechatPayUrl, setWechatPayUrl] = useState<string>('')
const [wechatPayUrl, setWechatPayUrl] = useState<any>('')
const [pageLoading, setPageLoading] = useState<boolean>(true)
useEffect(() => {
pay()
}, [])
const generateQrCode = (path: any) => {
// 生成二维码
QRCode.toDataURL(path).then((url: any) => {
setWechatPayUrl(url)
})
.catch((err: any) => {
console.error(err)
})
}
const pay = () => {
let param = {
id: Number(orderId),
......@@ -34,14 +46,20 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
}
//@ts-ignore
PublicApi.postOrderPendingOrderPay(param).then(res => {
if(res.code === 1000) {
message.destroy()
generateQrCode(res.data)
}
setPageLoading(false)
// setWechatPayUrl(res.data)
}).catch(() => {
onChange(false)
setPageLoading(false)
})
}
return (
<>
<Spin spinning={pageLoading}>
<div className={styles.common_title}>
<div className={styles.common_title_icon}><img src={wechatIcon} /></div>
<span>微信支付</span>
......@@ -49,7 +67,7 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
<div className={styles.wechat_payway}>
<p className={styles.wechat_payway_title}>使用微信扫一扫下方二维码</p>
<div className={styles.wechat_payway_imgbox}>
<img src={wechatImg} />
{wechatPayUrl && <img src={wechatPayUrl} />}
</div>
<div className={styles.wechat_payway_needpay}>
<label>当前需支付:</label>
......@@ -57,7 +75,7 @@ const WechatPayWay: React.FC<WechatPayWayPropsType> = (props) => {
<label>RMB</label>
</div>
</div>
</>
</Spin>
)
}
......
......@@ -22,7 +22,7 @@ interface PayPagePropsType {
}
enum PayWayType {
point = 'point', // 积分支付
point = 0, // 积分支付
balance = 4, // 余额支付
credit = 6, // 授信额度支付
wechat = 2, // 微信支付
......@@ -101,15 +101,15 @@ const PayPage: React.FC<PayPagePropsType> = (props) => {
switch (payInfo.paymentChannelsId) {
case PayWayType.point:
return <PointPayWay />
return <PointPayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
case PayWayType.balance:
return <BablancePayWay />
return <BablancePayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
case PayWayType.credit:
return <CreditPayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
case PayWayType.wechat:
return <WechatPayWay payInfo={payInfo} orderInfo={orderInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
case PayWayType.bank:
return <BankPayWay />
return <BankPayWay />
case PayWayType.transfer:
return <TransferPayWay payInfo={payInfo} orderId={orderId} onChange={(state) => handlePayChangge(state)} {...props} />
default:
......
......@@ -359,7 +359,7 @@ const Details: React.FC<parmas> = (props) => {
</div >
}
>
<Card className={style.item_wrap}>
<div className={style.item_wrap}>
{
Number(page_type) === 4 ?
<>
......@@ -419,8 +419,8 @@ const Details: React.FC<parmas> = (props) => {
</Tabs>
}
</Card>
<Card className={style.item_wrap}>
</div>
<div className={style.item_wrap}>
<div className={style.mainCol_title} style={view === 2 ? {paddingBottom: '0px'}: {paddingBottom: '24px'}}>询价商品</div>
{view === 1 && <Table columns={inquiryGoods} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />}
{view === 2 &&
......@@ -431,12 +431,12 @@ const Details: React.FC<parmas> = (props) => {
fetchTableData={(params: any) => fetchData(params)}
/>
}
</Card>
<Card className={style.item_wrap}>
<div className={style.mainCol_title}>{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].title}</div>
</div>
<div className={style.item_wrap}>
<div className={style.mainCol_title}>{infoTem[type === 'quote' ? 'freight' : 'base'].title}</div>
<div className={style['mainCol-rows']}>
<div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].leftElem.map(
{infoTem[type === 'quote' ? 'freight' : 'base'].leftElem.map(
(item: any, index: number) => {
return (
<div className={style['cols-main']} key={index}>
......@@ -452,7 +452,7 @@ const Details: React.FC<parmas> = (props) => {
)}
</div>
<div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].centerElem.map(
{infoTem[type === 'quote' ? 'freight' : 'base'].centerElem.map(
(item: any, index: number) => {
return (
<div className={style['cols-main']} key={index}>
......@@ -467,7 +467,7 @@ const Details: React.FC<parmas> = (props) => {
)}
</div>
<div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].rightElem.map(
{infoTem[type === 'quote' ? 'freight' : 'base'].rightElem.map(
(item: any, index: number) => {
return (
<div className={style['cols-main']} key={index}>
......@@ -482,8 +482,8 @@ const Details: React.FC<parmas> = (props) => {
)}
</div>
</div>
</Card>
<Card className={style.item_wrap}>
</div>
<div className={style.item_wrap}>
<div className={style.mainCol_title}>附件</div>
<div className={style.upload_data}>
{
......@@ -498,8 +498,8 @@ const Details: React.FC<parmas> = (props) => {
))
}
</div>
</Card>
<Card className={style.item_wrap}>
</div>
<div className={style.item_wrap}>
{
Number(page_type) === 4 ?
<>
......@@ -516,7 +516,7 @@ const Details: React.FC<parmas> = (props) => {
</TabPane>
</Tabs>
}
</Card>
</div>
<AuditModal
id={id}
type={page_type}
......
......@@ -3,6 +3,7 @@
margin-bottom: 24px;
background-color: #FFF;
border-radius: 8px;
padding: 24px;
&:last-child {
margin-bottom: 0px;
......
......@@ -79,6 +79,12 @@ const TradingConditions: React.FC<queryProps> = (props) => {
const addressOnChange = (value:any, option:any) => {
getAddress(option)
}
const disabledDate = (current) => {
return current && current < moment().endOf('day');
}
return (
<Form
{...layout}
......@@ -88,7 +94,10 @@ const TradingConditions: React.FC<queryProps> = (props) => {
<Row gutter={70}>
<Col span={12}>
<Form.Item label='交付日期' name='deliveryTime' rules={[{ required: true, message: '请选择交付日期' }]}>
<DatePicker format="YYYY-MM-DD HH:mm:ss" />
<DatePicker
disabledDate={disabledDate}
format="YYYY-MM-DD HH:mm:ss"
/>
</Form.Item>
<Form.Item label='交付地址' name='fullAddressId' rules={[{ required: true, message: '请选择交付地址' }]}>
<Select onChange={addressOnChange}>
......@@ -98,7 +107,10 @@ const TradingConditions: React.FC<queryProps> = (props) => {
</Select>
</Form.Item>
<Form.Item label='报价截止时间' name='quotationAsTime' rules={[{ required: true, message: '请选择报价截止时间' }]}>
<DatePicker format="YYYY-MM-DD HH:mm:ss" />
<DatePicker
format="YYYY-MM-DD HH:mm:ss"
disabledDate={disabledDate}
/>
</Form.Item>
<Form.Item label='报价要求' name='offer'>
<Input.TextArea placeholder='最长100个字符,50个汉字' />
......
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, ReactNode } from 'react';
import styles from './index.less';
import { Input, Table, Form } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
......@@ -17,16 +17,24 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
// 会员添加弹窗控制
const [goodsList, setgoodsList] = useState([]);
// 计算金额
const countMoney = (num: any, money: any) => {
let price: ReactNode = null;
price = (Number(money) * 1) / Number(num);
return Number(price).toFixed(4);
}
/**输入框输入 */
const inputOnchange = (id, e) => {
const { value } = e.target
goodsList.forEach(v => {
if (v.productId === id) {
v.money = value
v.price = countMoney(v.purchaseCount, value);
}
})
getGoodsList(goodsList) // 返回给父级
setgoodsList(goodsList)
getGoodsList([...goodsList]) // 返回给父级
setgoodsList([...goodsList])
}
const columns: ColumnType<any>[] = [{
......@@ -70,8 +78,12 @@ const EnquiryGoods: React.FC<queryProps> = (props) => {
console.log(123)
PublicApi.getOrderProductInquiryDetails({ id: inquiryNo.orderId }).then(res => {
if (res.code === 1000) {
getGoodsList(res.data.inquiryListProductRequests)
setgoodsList(res.data.inquiryListProductRequests)
const data = res.data.inquiryListProductRequests;
data.forEach((item: any) => {
item.money = item.purchaseCount * item.price
})
getGoodsList(data)
setgoodsList(data)
}
})
}
......
......@@ -403,7 +403,7 @@ const Details: React.FC<parmas> = (props) => {
</div >
}
>
<Card className={style.item_wrap}>
<div className={style.item_wrap}>
{
Number(page_type) === 4 ?
<>
......@@ -463,8 +463,8 @@ const Details: React.FC<parmas> = (props) => {
</Tabs>
}
</Card>
<Card className={style.item_wrap}>
</div>
<div className={style.item_wrap}>
<div className={style.mainCol_title}>询价商品</div>
{view === 1 && <Table columns={inquiryGoods} pagination={false} rowKey='id' dataSource={data.inquiryListProductRequests} />}
{view === 2 &&
......@@ -475,12 +475,12 @@ const Details: React.FC<parmas> = (props) => {
fetchTableData={(params: any) => fetchData(params)}
/>
}
</Card>
<Card className={style.item_wrap}>
<div className={style.mainCol_title}>{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].title}</div>
</div>
<div className={style.item_wrap}>
<div className={style.mainCol_title}>{infoTem[type === 'quote' ? 'freight' : 'base'].title}</div>
<div className={style['mainCol-rows']}>
<div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].leftElem.map(
{infoTem[type === 'quote' ? 'freight' : 'base'].leftElem.map(
(item: any, index: number) => {
return (
<div className={style['cols-main']} key={index}>
......@@ -496,7 +496,7 @@ const Details: React.FC<parmas> = (props) => {
)}
</div>
<div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].centerElem.map(
{infoTem[type === 'quote' ? 'freight' : 'base'].centerElem.map(
(item: any, index: number) => {
return (
<div className={style['cols-main']} key={index}>
......@@ -511,7 +511,7 @@ const Details: React.FC<parmas> = (props) => {
)}
</div>
<div className={style['mainCol-rows-cols']}>
{infoTem[(Number(page_type) === 1 || Number(page_type) === 5) ? 'freight' : 'base'].rightElem.map(
{infoTem[type === 'quote' ? 'freight' : 'base'].rightElem.map(
(item: any, index: number) => {
return (
<div className={style['cols-main']} key={index}>
......@@ -526,8 +526,8 @@ const Details: React.FC<parmas> = (props) => {
)}
</div>
</div>
</Card>
<Card className={style.item_wrap}>
</div>
<div className={style.item_wrap}>
<div className={style.mainCol_title}>附件</div>
<div className={style.upload_data}>
{
......@@ -542,8 +542,8 @@ const Details: React.FC<parmas> = (props) => {
))
}
</div>
</Card>
<Card className={style.item_wrap}>
</div>
<div className={style.item_wrap}>
{
Number(page_type) === 4 ?
<>
......@@ -560,7 +560,7 @@ const Details: React.FC<parmas> = (props) => {
</TabPane>
</Tabs>
}
</Card>
</div>
<AuditModal
id={id}
type={page_type}
......
......@@ -3,6 +3,7 @@
margin-bottom: 24px;
background-color: #FFF;
border-radius: 8px;
padding: 24px;
&:last-child {
margin-bottom: 0px;
......
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