Commit b4269c7f authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:处理采购下单查找运费提示为数量不能为空

parent cbe457d1
...@@ -14,10 +14,10 @@ import cx from 'classnames' ...@@ -14,10 +14,10 @@ import cx from 'classnames'
import ReutrnEle from '@/components/ReturnEle' import ReutrnEle from '@/components/ReturnEle'
import styles from "./index.less" import styles from "./index.less"
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { import {
GetProductCommodityGetCommodityResponse, GetProductCommodityGetCommodityResponse,
GetProductCommodityGetCommodityCheckRecordResponse, GetProductCommodityGetCommodityCheckRecordResponse,
GetProductCommodityGetShopResponse GetProductCommodityGetShopResponse
} from '@/services/ProductApi' } from '@/services/ProductApi'
import moment from 'moment' import moment from 'moment'
import { isGetAccessor } from 'typescript' import { isGetAccessor } from 'typescript'
...@@ -92,13 +92,13 @@ const viewProducts: React.FC<{}> = () => { ...@@ -92,13 +92,13 @@ const viewProducts: React.FC<{}> = () => {
setLogisticResourceSendAddress(provinceName + cityName + districtName + address) setLogisticResourceSendAddress(provinceName + cityName + districtName + address)
}) })
}, [productDetail]) }, [productDetail])
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
title: '序号', title: '序号',
dataIndex: 'memberRoleId', dataIndex: 'memberRoleId',
key: 'memberRoleId', key: 'memberRoleId',
render: (t, c, i) => i + 1 render: (t, c, i) => i + 1
}, },
{ {
title: '角色', title: '角色',
...@@ -139,7 +139,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -139,7 +139,7 @@ const viewProducts: React.FC<{}> = () => {
title: '操作时间', title: '操作时间',
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTime', key: 'createTime',
render: (text: any) => moment(text).format("YYYY-MM-DD HH:mm:ss") render: (text: any) => moment(text).format("YYYY-MM-DD HH:mm:ss")
}, },
{ {
title: '意见', title: '意见',
...@@ -190,7 +190,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -190,7 +190,7 @@ const viewProducts: React.FC<{}> = () => {
component = null component = null
}else }else
if (status === 5) if (status === 5)
component = (<span style={{ color: '#00B37A', padding: '2px 5px', background: 'rgba(235,247,242,1)', borderRadius: '4px' }}>已上架</span>) component = (<span style={{ color: '#00B37A', padding: '2px 5px', background: 'rgba(235,247,242,1)', borderRadius: '4px' }}>已上架</span>)
else if (status === 6) else if (status === 6)
component = (<span style={{ padding: '2px 5px', background: 'rgba(244,245,247,1)', borderRadius: '4px' }}>已下架</span>) component = (<span style={{ padding: '2px 5px', background: 'rgba(244,245,247,1)', borderRadius: '4px' }}>已下架</span>)
else else
...@@ -212,7 +212,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -212,7 +212,7 @@ const viewProducts: React.FC<{}> = () => {
<Descriptions.Item label="商品品牌">{productDetail?.brand?.name}</Descriptions.Item> <Descriptions.Item label="商品品牌">{productDetail?.brand?.name}</Descriptions.Item>
<Descriptions.Item label="商品品类">{productDetail?.customerCategory?.fullName}</Descriptions.Item> <Descriptions.Item label="商品品类">{productDetail?.customerCategory?.fullName}</Descriptions.Item>
{/* { {/* {
productDetail?.commodityShopList?.length>0 && productDetail?.commodityShopList?.length>0 &&
<Descriptions.Item label="上架商城"> <Descriptions.Item label="上架商城">
{ {
productDetail.commodityShopList.map((item, index)=><span key={index}><img width="24" height="24" style={{borderRadius: '50%', marginRight: 4}} src={item.logoUrl} title={item.name} alt={item.name}/></span>) productDetail.commodityShopList.map((item, index)=><span key={index}><img width="24" height="24" style={{borderRadius: '50%', marginRight: 4}} src={item.logoUrl} title={item.name} alt={item.name}/></span>)
...@@ -224,7 +224,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -224,7 +224,7 @@ const viewProducts: React.FC<{}> = () => {
<Descriptions.Item label="商品类型"><span className="commonStatusValid"></span>{renderCustomerCategoryType(productDetail?.customerCategory?.type)}</Descriptions.Item> <Descriptions.Item label="商品类型"><span className="commonStatusValid"></span>{renderCustomerCategoryType(productDetail?.customerCategory?.type)}</Descriptions.Item>
</Descriptions> </Descriptions>
</> </>
const renderPriceType = (type: number) => { const renderPriceType = (type: number) => {
if(type === 1 ) return '现货价格' if(type === 1 ) return '现货价格'
if(type === 2 ) return '价格需要询价' if(type === 2 ) return '价格需要询价'
...@@ -262,22 +262,22 @@ const viewProducts: React.FC<{}> = () => { ...@@ -262,22 +262,22 @@ const viewProducts: React.FC<{}> = () => {
}) })
attributeByValue.map(_ => { attributeByValue.map(_ => {
_col.push({ _col.push({
title: _.name, title: _.name,
dataIndex: _.name, dataIndex: _.name,
key: '索引' key: '索引'
}) })
}) })
} }
if(item.goods?.id){ // 存在货品 if(item.goods?.id){ // 存在货品
_col.push({ _col.push({
title: '对应货品', title: '对应货品',
dataIndex: '对应货品', dataIndex: '对应货品',
key: '索引', key: '索引',
}) })
} }
} }
_col.push({ _col.push({
title: product?.priceType===3?'所需积分':'单价(元)', title: product?.priceType===3?'所需积分':'单价(元)',
dataIndex: '单价', dataIndex: '单价',
key: '单价', key: '单价',
render: (text, record) => { render: (text, record) => {
...@@ -344,8 +344,8 @@ const viewProducts: React.FC<{}> = () => { ...@@ -344,8 +344,8 @@ const viewProducts: React.FC<{}> = () => {
return <> return <>
<p> <p>
{ {
str === 'area' str === 'area'
? ?
showDataSource.map((_item, _i) => <p key={_i}>{_item.provinceName+'/'+(_item.cityName||'')}</p>) showDataSource.map((_item, _i) => <p key={_i}>{_item.provinceName+'/'+(_item.cityName||'')}</p>)
: :
showDataSource.map((_item, _i) => <p key={_i}>{_item.name}</p>) showDataSource.map((_item, _i) => <p key={_i}>{_item.name}</p>)
...@@ -419,7 +419,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -419,7 +419,7 @@ const viewProducts: React.FC<{}> = () => {
</Col> </Col>
</Row> </Row>
{ {
productDetail?.commodityShopList?.length>0 && productDetail?.commodityShopList?.length>0 &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>上架商城:</p> <p>上架商城:</p>
...@@ -438,7 +438,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -438,7 +438,7 @@ const viewProducts: React.FC<{}> = () => {
<Col span={8}> <Col span={8}>
<Card headStyle={{borderBottom:'none'}} title="物流信息" style={{height:'100%'}}> <Card headStyle={{borderBottom:'none'}} title="物流信息" style={{height:'100%'}}>
{ {
renderDeliveryType(productDetail?.logistics?.deliveryType) && renderDeliveryType(productDetail?.logistics?.deliveryType) &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>配送方式:</p> <p>配送方式:</p>
...@@ -460,7 +460,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -460,7 +460,7 @@ const viewProducts: React.FC<{}> = () => {
</Row> </Row>
} }
{ {
productDetail?.logistics?.weight && productDetail?.logistics?.weight &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>重量:</p> <p>重量:</p>
...@@ -471,7 +471,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -471,7 +471,7 @@ const viewProducts: React.FC<{}> = () => {
</Row> </Row>
} }
{ {
logisticTemplateName && logisticTemplateName &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>运费模版:</p> <p>运费模版:</p>
...@@ -482,7 +482,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -482,7 +482,7 @@ const viewProducts: React.FC<{}> = () => {
</Row> </Row>
} }
{ {
logisticResourceCompanyName && logisticResourceCompanyName &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>物流公司:</p> <p>物流公司:</p>
...@@ -493,7 +493,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -493,7 +493,7 @@ const viewProducts: React.FC<{}> = () => {
</Row> </Row>
} }
{ {
logisticResourceSendAddress && logisticResourceSendAddress &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>发货地址:</p> <p>发货地址:</p>
...@@ -613,7 +613,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -613,7 +613,7 @@ const viewProducts: React.FC<{}> = () => {
<Col span={6}> <Col span={6}>
<p> <p>
{ {
productDetail?.isMemberPrice && '允许使用会员折扣购买' productDetail?.isMemberPrice ? '允许使用会员折扣购买' : '无'
} }
</p> </p>
</Col> </Col>
...@@ -637,7 +637,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -637,7 +637,7 @@ const viewProducts: React.FC<{}> = () => {
{/* 没有价格属性默认一行直接显示图片 */} {/* 没有价格属性默认一行直接显示图片 */}
<div className={styles.productImgBox}> <div className={styles.productImgBox}>
{ {
productDetail?.unitPriceAndPicList[0].commodityPic.length>0 && productDetail?.unitPriceAndPicList[0].commodityPic.map((_item, index) => productDetail?.unitPriceAndPicList[0].commodityPic.length>0 && productDetail?.unitPriceAndPicList[0].commodityPic.map((_item, index) =>
<div key={index} className={styles.imgItem}><img className={styles.pic} src={_item} alt=""/> <div key={index} className={styles.imgItem}><img className={styles.pic} src={_item} alt=""/>
</div>) </div>)
} }
...@@ -665,7 +665,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -665,7 +665,7 @@ const viewProducts: React.FC<{}> = () => {
<Divider /> <Divider />
<div className={styles.productImgBox}> <div className={styles.productImgBox}>
{ {
imageArrByImageRender.length>0 && imageArrByImageRender[index].map((_item, _index) => imageArrByImageRender.length>0 && imageArrByImageRender[index].map((_item, _index) =>
<div key={_index} className={styles.imgItem}><img className={styles.pic} src={_item} alt=""/> <div key={_index} className={styles.imgItem}><img className={styles.pic} src={_item} alt=""/>
</div>) </div>)
} }
...@@ -680,7 +680,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -680,7 +680,7 @@ const viewProducts: React.FC<{}> = () => {
<Card headStyle={{borderBottom:'none'}} title="商品描述"> <Card headStyle={{borderBottom:'none'}} title="商品描述">
{/* 文字区块 */} {/* 文字区块 */}
{ {
productDetail?.commodityRemark?.word?.length>0 && productDetail?.commodityRemark?.word?.length>0 &&
<div className={cx(styles.descriptionBox, styles.descriptionWordBox)}> <div className={cx(styles.descriptionBox, styles.descriptionWordBox)}>
{ {
productDetail?.commodityRemark?.word.map((_item, _index) => productDetail?.commodityRemark?.word.map((_item, _index) =>
...@@ -691,7 +691,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -691,7 +691,7 @@ const viewProducts: React.FC<{}> = () => {
} }
{/* 视频区块 */} {/* 视频区块 */}
{ {
productDetail?.commodityRemark?.video?.length>0 && productDetail?.commodityRemark?.video?.length>0 &&
<div className={styles.descriptionBox}> <div className={styles.descriptionBox}>
{ {
productDetail?.commodityRemark?.video.map((_item, _index)=> <div key={_index} className={styles.videoItem}> productDetail?.commodityRemark?.video.map((_item, _index)=> <div key={_index} className={styles.videoItem}>
...@@ -704,7 +704,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -704,7 +704,7 @@ const viewProducts: React.FC<{}> = () => {
} }
{/* 图片区块 */} {/* 图片区块 */}
{ {
productDetail?.commodityRemark?.image?.length>0 && productDetail?.commodityRemark?.image?.length>0 &&
<div className={styles.descriptionBox}> <div className={styles.descriptionBox}>
{ {
productDetail?.commodityRemark?.image.map((_item, _index)=> _item && <div key={_index} className={styles.imgItem}> productDetail?.commodityRemark?.image.map((_item, _index)=> _item && <div key={_index} className={styles.imgItem}>
......
...@@ -206,8 +206,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -206,8 +206,6 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
}).then(res => { }).then(res => {
if(res.code === 1000) { if(res.code === 1000) {
setBalanceInfo(res.data) setBalanceInfo(res.data)
} else {
message.error(res.message)
} }
setIsSpin(false) setIsSpin(false)
}) })
......
...@@ -71,7 +71,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => { ...@@ -71,7 +71,7 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
orderProductList: logsiticsDataMaps.map(v => ({ orderProductList: logsiticsDataMaps.map(v => ({
templateId: v.logistics.templateId, templateId: v.logistics.templateId,
weight: v.logistics.weight, weight: v.logistics.weight,
count: v?.purchaseCount || null count: v?.purchaseCount || 0
})), })),
receiverAddressId: typeof receiverAddressId === 'object' ? receiverAddressId.id : receiverAddressId receiverAddressId: typeof receiverAddressId === 'object' ? receiverAddressId.id : receiverAddressId
}, {ttl: 10 * 1000, useCache: true, ctlType: 'none'}).then(res => { }, {ttl: 10 * 1000, useCache: true, ctlType: 'none'}).then(res => {
......
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