Commit 65f5a820 authored by GuanHua's avatar GuanHua
parents 439f1e6c f27d1bee
...@@ -92,6 +92,7 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -92,6 +92,7 @@ const AddProducts: React.FC<{}> = (props) => {
keywords: data.keywords, keywords: data.keywords,
description: data.description, description: data.description,
type: data.type, type: data.type,
createTime: data.createTime,
}) })
setProductName(data?.name) setProductName(data?.name)
setProductPriceType(data?.priceType) setProductPriceType(data?.priceType)
......
import React, { useState, useEffect, useRef, useMemo } from 'react' import React, { useState, useEffect, useRef, useMemo } from 'react'
import { history } from 'umi' import { history } from 'umi'
import { Button, Form, Select, Checkbox, Tooltip, Radio, Input, Table, Modal, Row, Col, InputNumber, Space } from 'antd' import { Button, Form, Select, Checkbox, Tooltip, Radio, Input, Table, Modal, Row, Col, InputNumber, Space } from 'antd'
import styles from './index.less' // import styles from './index.less'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { ColumnType } from 'antd/lib/table/interface' import { ColumnType } from 'antd/lib/table/interface'
import { QuestionCircleOutlined, SettingOutlined, PlusOutlined, MinusOutlined, } from '@ant-design/icons' import { QuestionCircleOutlined, SettingOutlined, PlusOutlined, MinusOutlined, } from '@ant-design/icons'
import { inject, observer } from 'mobx-react' import { observer } from 'mobx-react'
import { store } from '@/store' import { store } from '@/store'
import { IProductSelectAttribute } from '@/module/productModule' import { IProductSelectAttribute } from '@/module/productModule'
import { orderlyLadderPrice, validatorNumberRange } from '../constant' import { orderlyLadderPrice, validatorNumberRange } from '../constant'
const _ = require("lodash");
const layout = { const layout = {
labelCol: { labelCol: {
span: 2, span: 2,
......
...@@ -152,6 +152,11 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => { ...@@ -152,6 +152,11 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
_isPrice = attrItem.isPrice _isPrice = attrItem.isPrice
_isUpdateAttribute = productInfoByEdit.isUpdateAttribute _isUpdateAttribute = productInfoByEdit.isUpdateAttribute
_isDisabled = _isPrice && !_isUpdateAttribute _isDisabled = _isPrice && !_isUpdateAttribute
// 编辑中 过滤后续添加的属性
if(!_isUpdateAttribute && (attrItem.createTime > productInfoByEdit.createTime)) {
return null
}
console.log(attrItem, attributesData, productInfoByEdit, 'data')
} }
return ( return (
...@@ -262,7 +267,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => { ...@@ -262,7 +267,7 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
<Tabs defaultActiveKey="1" tabPosition="left"> <Tabs defaultActiveKey="1" tabPosition="left">
{ {
attributesData?.length > 0 && attributesData.map(attributeItem => attributesData?.length > 0 && attributesData.map(attributeItem =>
<TabPane tab={attributeItem.name} key={attributeItem.id}> !productInfoByEdit.isUpdateAttribute && (attributeItem.createTime > productInfoByEdit.createTime) ? null : <TabPane tab={attributeItem.name} key={attributeItem.id}>
{ {
renderTabPanchildren(attributeItem) renderTabPanchildren(attributeItem)
} }
......
...@@ -387,14 +387,14 @@ const viewProducts: React.FC<{}> = () => { ...@@ -387,14 +387,14 @@ const viewProducts: React.FC<{}> = () => {
</Col> </Col>
<Col span={8}> <Col span={8}>
<Card headStyle={{borderBottom:'none'}} title="其他信息" style={{height:'100%'}}> <Card headStyle={{borderBottom:'none'}} title="其他信息" style={{height:'100%'}}>
<Row> {/* <Row>
<Col span={4}> <Col span={4}>
<p>提供发票:</p> <p>提供发票:</p>
</Col> </Col>
<Col span={20}> <Col span={20}>
<p>{productDetail?.isInvoice?'是':'否'}</p> <p>{productDetail?.isInvoice?'是':'否'}</p>
</Col> </Col>
</Row> </Row> */}
<Row> <Row>
<Col span={4}> <Col span={4}>
<p>税率:</p> <p>税率:</p>
......
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