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

fix:

parent f087d4ba
...@@ -115,6 +115,9 @@ const ClassProperty: React.FC<{}> = () => { ...@@ -115,6 +115,9 @@ const ClassProperty: React.FC<{}> = () => {
} }
const handlePlateformSelect = (key, node) => { const handlePlateformSelect = (key, node) => {
if (node.children && node.children.length > 0) {
return ;
}
setPlateformSelectNode({id: key*1, name: node._title}) setPlateformSelectNode({id: key*1, name: node._title})
} }
......
...@@ -139,10 +139,15 @@ const AddPropertyValue: React.FC<{}> = () => { ...@@ -139,10 +139,15 @@ const AddPropertyValue: React.FC<{}> = () => {
} }
const handlePlateformSelect = (key, node) => { const handlePlateformSelect = (key, node) => {
if (node.children && node.children.length > 0) {
return ;
}
if(key){
let arr = key.split('_') let arr = key.split('_')
setSelectKey(arr[arr.length-1]*1) setSelectKey(arr[arr.length-1]*1)
setSelectRow(node) setSelectRow(node)
} }
}
const onCommodityAreaChange = (value: any, selected: any) => { const onCommodityAreaChange = (value: any, selected: any) => {
let arr = selected.map(item => item.name) let arr = selected.map(item => item.name)
......
...@@ -592,6 +592,10 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => { ...@@ -592,6 +592,10 @@ const PriceAttributeForm: React.FC<Iprops> = (props) => {
} }
rules={[ rules={[
{ {
required: true,
message: '请输入最小起订数'
},
{
pattern: /^\d+(\.\d{1,3})?$/, pattern: /^\d+(\.\d{1,3})?$/,
message: '最小起订数小数点后仅限三位', message: '最小起订数小数点后仅限三位',
} }
......
...@@ -99,16 +99,24 @@ const FastModifyPrice: React.FC<{}> = () => { ...@@ -99,16 +99,24 @@ const FastModifyPrice: React.FC<{}> = () => {
dataIndex: 'min', dataIndex: 'min',
key: 'min', key: 'min',
render: (text:any, reocrd:any) => { render: (text:any, reocrd:any) => {
if(reocrd.priceType === 1) if(reocrd.priceType === 1){
if(reocrd.min === reocrd.min)
return <>{reocrd.min}</>
else
return <>{reocrd.min} ~ ¥{reocrd.max}</> return <>{reocrd.min} ~ ¥{reocrd.max}</>
if(reocrd.priceType === 3) }
if(reocrd.priceType === 3){
if(reocrd.min === reocrd.min)
return <>{reocrd.min}</>
else
return <>{reocrd.min} ~ {reocrd.max}</> return <>{reocrd.min} ~ {reocrd.max}</>
}
if(reocrd.priceType === 2) if(reocrd.priceType === 2)
return null return null
} }
}, },
{ {
title: '审核时间', title: '申请审核时间',
dataIndex: 'applyTime', dataIndex: 'applyTime',
key: 'applyTime', key: 'applyTime',
render: (text: any, record: any) => text && moment(text).format('YYYY-MM-DD HH:mm:ss') render: (text: any, record: any) => text && moment(text).format('YYYY-MM-DD HH:mm:ss')
...@@ -124,9 +132,9 @@ const FastModifyPrice: React.FC<{}> = () => { ...@@ -124,9 +132,9 @@ const FastModifyPrice: React.FC<{}> = () => {
else if (record.status === 2) else if (record.status === 2)
component = (<><span className="commonStatusModify"></span>待审核</>) component = (<><span className="commonStatusModify"></span>待审核</>)
else if (record.status === 3) else if (record.status === 3)
component = (<><span className="commonStatusValid"></span>审核通过</>)
else if (record.status === 4)
component = (<><span className="commonStatusInvalid"></span>审核不通过</>) component = (<><span className="commonStatusInvalid"></span>审核不通过</>)
else if (record.status === 4)
component = (<><span className="commonStatusValid"></span>审核通过</>)
else if (record.status === 5) else if (record.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 (record.status === 6) else if (record.status === 6)
...@@ -358,7 +366,7 @@ const FastModifyPrice: React.FC<{}> = () => { ...@@ -358,7 +366,7 @@ const FastModifyPrice: React.FC<{}> = () => {
<Col span={4}> <Col span={4}>
<Select value={filterParams.priceType} onChange={(v) => setFilterParams({ ...filterParams, priceType: +v })} style={{ width: '100%' }} placeholder="商品定价"> <Select value={filterParams.priceType} onChange={(v) => setFilterParams({ ...filterParams, priceType: +v })} style={{ width: '100%' }} placeholder="商品定价">
<Option value={1}>现货价格</Option> <Option value={1}>现货价格</Option>
<Option value={2}>价格需要询价</Option> {/* <Option value={2}>价格需要询价</Option> */}
<Option value={3}>积分兑换商品</Option> <Option value={3}>积分兑换商品</Option>
</Select> </Select>
</Col> </Col>
......
...@@ -181,11 +181,15 @@ const viewProducts: React.FC<{}> = () => { ...@@ -181,11 +181,15 @@ const viewProducts: React.FC<{}> = () => {
component = (<><span className="commonStatusValid"></span>审核通过</>) component = (<><span className="commonStatusValid"></span>审核通过</>)
else if (status === 3) else if (status === 3)
component = (<><span className="commonStatusInvalid"></span>审核不通过</>) component = (<><span className="commonStatusInvalid"></span>审核不通过</>)
else
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
component = null
return component return component
} }
...@@ -202,13 +206,16 @@ const viewProducts: React.FC<{}> = () => { ...@@ -202,13 +206,16 @@ const viewProducts: React.FC<{}> = () => {
<Descriptions colon={true} style={{paddingLeft:128}}> <Descriptions colon={true} style={{paddingLeft:128}}>
<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 &&
<Descriptions.Item label="上架商城"> <Descriptions.Item label="上架商城">
{ {
productDetail?.commodityShopList?.length>0 && productDetail.commodityShopList.map((item, index)=><span key={index}>{item.name}&nbsp;</span>) productDetail.commodityShopList.map((item, index)=><span key={index}>{item.name}&nbsp;</span>)
} }
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="审核状态">{renderStatus(productDetail?.status, 1)}</Descriptions.Item> }
<Descriptions.Item label="商品状态">{renderStatus(productDetail?.status, 2)}</Descriptions.Item> {renderStatus(productDetail?.status, 1) && <Descriptions.Item label="审核状态">{renderStatus(productDetail?.status, 1)}</Descriptions.Item>}
{renderStatus(productDetail?.status, 2) && <Descriptions.Item label="商品状态">{renderStatus(productDetail?.status, 2)}</Descriptions.Item>}
<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>
</> </>
...@@ -221,8 +228,9 @@ const viewProducts: React.FC<{}> = () => { ...@@ -221,8 +228,9 @@ const viewProducts: React.FC<{}> = () => {
const renderDeliveryType = (type: number) => { const renderDeliveryType = (type: number) => {
if(type === 1) return '物流(默认)' if(type === 1) return '物流(默认)'
if(type === 2) return '自提' else if(type === 2) return '自提'
if(type === 3) return '无需配送' else if(type === 3) return '无需配送'
else return null
} }
const renderCarriageType = (type: number) => { const renderCarriageType = (type: number) => {
...@@ -283,6 +291,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -283,6 +291,7 @@ const viewProducts: React.FC<{}> = () => {
let _imageArrByImageRender: any[] = [] let _imageArrByImageRender: any[] = []
_tableData = unitPriceAndPicList.map((item, index) => { _tableData = unitPriceAndPicList.map((item, index) => {
_imageArrByImageRender.push(item.commodityPic) _imageArrByImageRender.push(item.commodityPic)
console.log(item)
let attrArrayWithObj = item.attributeAndValueList.map(_item=>{ let attrArrayWithObj = item.attributeAndValueList.map(_item=>{
let _temp = {} let _temp = {}
_temp[_item.customerAttribute.name] = _item.customerAttributeValue.value _temp[_item.customerAttribute.name] = _item.customerAttributeValue.value
...@@ -338,22 +347,26 @@ const viewProducts: React.FC<{}> = () => { ...@@ -338,22 +347,26 @@ const viewProducts: React.FC<{}> = () => {
<Row gutter={[26,0]}> <Row gutter={[26,0]}>
<Col span={8}> <Col span={8}>
<Card headStyle={{borderBottom:'none'}} title="基本信息" style={{height:'320px'}}> <Card headStyle={{borderBottom:'none'}} title="基本信息" style={{height:'320px'}}>
<Row> {
productDetail?.slogan && <Row>
<Col span={4}> <Col span={4}>
<p>商品标语:</p> <p>商品标语:</p>
</Col> </Col>
<Col span={20}> <Col span={20}>
<p>{productDetail?.slogan}</p> <p>{productDetail.slogan}</p>
</Col> </Col>
</Row> </Row>
<Row> }
{
productDetail?.sellingPoint?.length > 0 && <Row>
<Col span={4}> <Col span={4}>
<p>商品卖点:</p> <p>商品卖点:</p>
</Col> </Col>
<Col span={20}> <Col span={20}>
<p>{productDetail?.sellingPoint && productDetail?.sellingPoint.map(_item => <Tag key={_item}>{_item}</Tag>)}</p> <p>{productDetail.sellingPoint.map(_item => <Tag key={_item}>{_item}</Tag>)}</p>
</Col> </Col>
</Row> </Row>
}
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>归属地市:</p> <p>归属地市:</p>
...@@ -370,6 +383,8 @@ const viewProducts: React.FC<{}> = () => { ...@@ -370,6 +383,8 @@ const viewProducts: React.FC<{}> = () => {
</Col> </Col>
<Col span={8}> <Col span={8}>
<Card headStyle={{borderBottom:'none'}} title="物流信息" style={{height:'320px'}}> <Card headStyle={{borderBottom:'none'}} title="物流信息" style={{height:'320px'}}>
{
renderDeliveryType(productDetail?.logistics?.deliveryType) &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>配送方式:</p> <p>配送方式:</p>
...@@ -378,6 +393,9 @@ const viewProducts: React.FC<{}> = () => { ...@@ -378,6 +393,9 @@ const viewProducts: React.FC<{}> = () => {
<p>{renderDeliveryType(productDetail?.logistics?.deliveryType)}</p> <p>{renderDeliveryType(productDetail?.logistics?.deliveryType)}</p>
</Col> </Col>
</Row> </Row>
}
{
renderCarriageType(productDetail?.logistics?.carriageType) &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>运送方式:</p> <p>运送方式:</p>
...@@ -386,14 +404,20 @@ const viewProducts: React.FC<{}> = () => { ...@@ -386,14 +404,20 @@ const viewProducts: React.FC<{}> = () => {
<p>{renderCarriageType(productDetail?.logistics?.carriageType)}</p> <p>{renderCarriageType(productDetail?.logistics?.carriageType)}</p>
</Col> </Col>
</Row> </Row>
}
{
productDetail?.logistics?.weight &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>重量:</p> <p>重量:</p>
</Col> </Col>
<Col span={20}> <Col span={20}>
<p>{productDetail?.logistics?.weight}KG(公斤)</p> <p>{productDetail.logistics.weight}KG(公斤)</p>
</Col> </Col>
</Row> </Row>
}
{
logisticTemplateName &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>运费模版:</p> <p>运费模版:</p>
...@@ -402,6 +426,9 @@ const viewProducts: React.FC<{}> = () => { ...@@ -402,6 +426,9 @@ const viewProducts: React.FC<{}> = () => {
<p>{logisticTemplateName}</p> <p>{logisticTemplateName}</p>
</Col> </Col>
</Row> </Row>
}
{
logisticResourceCompanyName &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>物流公司:</p> <p>物流公司:</p>
...@@ -410,6 +437,9 @@ const viewProducts: React.FC<{}> = () => { ...@@ -410,6 +437,9 @@ const viewProducts: React.FC<{}> = () => {
<p>{logisticResourceCompanyName}</p> <p>{logisticResourceCompanyName}</p>
</Col> </Col>
</Row> </Row>
}
{
logisticResourceSendAddress &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>发货地址:</p> <p>发货地址:</p>
...@@ -418,6 +448,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -418,6 +448,7 @@ const viewProducts: React.FC<{}> = () => {
<p>{logisticResourceSendAddress}</p> <p>{logisticResourceSendAddress}</p>
</Col> </Col>
</Row> </Row>
}
</Card> </Card>
</Col> </Col>
<Col span={8}> <Col span={8}>
...@@ -430,6 +461,8 @@ const viewProducts: React.FC<{}> = () => { ...@@ -430,6 +461,8 @@ const viewProducts: React.FC<{}> = () => {
<p>{productDetail?.isInvoice?'是':'否'}</p> <p>{productDetail?.isInvoice?'是':'否'}</p>
</Col> </Col>
</Row> </Row>
{
productDetail?.marks &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>唛头:</p> <p>唛头:</p>
...@@ -438,6 +471,9 @@ const viewProducts: React.FC<{}> = () => { ...@@ -438,6 +471,9 @@ const viewProducts: React.FC<{}> = () => {
<p>{productDetail?.marks}</p> <p>{productDetail?.marks}</p>
</Col> </Col>
</Row> </Row>
}
{
productDetail?.packing &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>包装清单:</p> <p>包装清单:</p>
...@@ -446,6 +482,9 @@ const viewProducts: React.FC<{}> = () => { ...@@ -446,6 +482,9 @@ const viewProducts: React.FC<{}> = () => {
<p>{productDetail?.packing}</p> <p>{productDetail?.packing}</p>
</Col> </Col>
</Row> </Row>
}
{
productDetail?.afterService &&
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>售后服务:</p> <p>售后服务:</p>
...@@ -454,6 +493,7 @@ const viewProducts: React.FC<{}> = () => { ...@@ -454,6 +493,7 @@ const viewProducts: React.FC<{}> = () => {
<p>{productDetail?.afterService}</p> <p>{productDetail?.afterService}</p>
</Col> </Col>
</Row> </Row>
}
</Card> </Card>
</Col> </Col>
</Row> </Row>
......
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