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

fix: 品类属性多租户隐藏关联平台品类input,新增商品不先输入价格操作下一步清空属性选择

parent ce662a55
......@@ -41,6 +41,7 @@ const AddAtttribute: React.FC<{}> = () => {
const [isSee, setIsSee] = useState(false) // 判断查看依据
const [isSpecial, setIsSpecial] = useState(false) //特殊属性禁用展示方式
const [submitLoading, setSubmitLoading] = useState<boolean>(false)
const { isMultiple } = history.location.query
useEffect(() => {
const { location } = history
......@@ -322,30 +323,32 @@ const AddAtttribute: React.FC<{}> = () => {
<Input disabled />
</Form.Item>
</Col>
<Col span={18}>
<Form.Item
label={
<span>
{intl.formatMessage({ id: 'classAndProperty.attribute.addAttribute.form.attributeGroupName' })}&nbsp;
<Tooltip title={intl.formatMessage({ id: 'classAndProperty.attribute.addAttribute.form.attributeGroupName.tooltip' })}>
<QuestionCircleOutlined />
</Tooltip>
</span>
}
>
<Row>
<Col span={20}>
<Form.Item name={['attribute', 'name']} style={{ display: 'none' }}><Input disabled /></Form.Item>
<Form.Item name="attributeShow" noStyle><Input disabled /></Form.Item>
</Col>
<Col span={4}>
<Button type="primary" icon={<LinkOutlined />} disabled={isSee} style={{ backgroundColor: '#909399', borderColor: '#909399' }} onClick={() => handleLink()}>
{intl.formatMessage({ id: 'classAndProperty.attribute.addAttribute.form.attributeGroupName.button' })}
</Button>
</Col>
</Row>
</Form.Item>
</Col>
{
!isMultiple && <Col span={18}>
<Form.Item
label={
<span>
{intl.formatMessage({ id: 'classAndProperty.attribute.addAttribute.form.attributeGroupName' })}&nbsp;
<Tooltip title={intl.formatMessage({ id: 'classAndProperty.attribute.addAttribute.form.attributeGroupName.tooltip' })}>
<QuestionCircleOutlined />
</Tooltip>
</span>
}
>
<Row>
<Col span={20}>
<Form.Item name={['attribute', 'name']} style={{ display: 'none' }}><Input disabled /></Form.Item>
<Form.Item name="attributeShow" noStyle><Input disabled /></Form.Item>
</Col>
<Col span={4}>
<Button type="primary" icon={<LinkOutlined />} disabled={isSee} style={{ backgroundColor: '#909399', borderColor: '#909399' }} onClick={() => handleLink()}>
{intl.formatMessage({ id: 'classAndProperty.attribute.addAttribute.form.attributeGroupName.button' })}
</Button>
</Col>
</Row>
</Form.Item>
</Col>
}
<Col span={18}>
<Form.Item
label={intl.formatMessage({ id: 'classAndProperty.attribute.addAttribute.form.isEnable' })}
......
......@@ -245,7 +245,7 @@ const Attribute: React.FC<{}> = () => {
const Actions = (
<Space>
<Button type="primary" icon={<PlusOutlined />} onClick={() => { history.push('/memberCenter/commodityAbility/classAndProperty/attribute/add') }}>
<Button type="primary" icon={<PlusOutlined />} onClick={() => { history.push(`/memberCenter/commodityAbility/classAndProperty/attribute/add?isMultiple=${isMultiple}`) }}>
{intl.formatMessage({ id: 'classAndProperty.attribute.actions.button.1' })}
</Button>
{
......
......@@ -247,6 +247,15 @@ const ClassProperty: React.FC<{}> = () => {
onSubmit={onFinish}
actions={formActions}
effects={($, action) => {
$('onFormMount').subscribe(() => {
console.log(isMultiple, 'isMultiple')
if(isMultiple) {
action.setFieldState('category', state => {
state.display = false
state.visible = false
})
}
})
flag = false
$(ON_FORM_INPUT_CHANGE).subscribe(() => {
setIsEditForm(true)
......
......@@ -48,6 +48,9 @@ const AddPropertyValue: React.FC<{}> = () => {
const [customPlateformExpandkeys, setCustomPlateformExpandkeys] = useState<any>()
const [submitLoading, setSubmitLoading] = useState<boolean>(false)
const { isMultiple } = history.location.query
/* 平台属性值列表树 */
const {
treeData,
......@@ -99,21 +102,24 @@ const AddPropertyValue: React.FC<{}> = () => {
const handleSubmitAllSetting = () => {
setSubmitLoading(true)
attrValueForm.validateFields().then(values => {
const { attrId, attrName, type } = history.location.query
const { attrId, attrName, type, isMultiple } = history.location.query
let pararms: any = { ...values }
delete pararms.attributeName
if (JSON.stringify(pararms.attributeValue) === '{}')
if (JSON.stringify(pararms.attributeValue) === '{}') {
delete pararms.attributeValue
if (type === '2')
}
if (type === '2') {
pararms.value = areaString
if (type === '1')
}
if (type === '1') {
pararms.value = intl.formatMessage({ id: 'classAndProperty.addPropertyValue.datetText' }) + parseInt(Math.random() * 100 + '')
}
postProductCustomerSaveOrUpdateCustomerAttributeValue(pararms).then(res => {
if (res.code === 1000)
// history.goBack()
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue?attrId=${attrId}&attrName=${attrName}&type=${type}`)
else
if (res.code === 1000) {
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue?attrId=${attrId}&attrName=${attrName}&type=${type}&isMultiple=${isMultiple}`)
} else {
setSubmitLoading(false)
}
})
}).catch(error => {
......@@ -256,28 +262,30 @@ const AddPropertyValue: React.FC<{}> = () => {
</Form.Item>
}
</Col>
<Col span={18}>
<Form.Item
label={
<span>
{intl.formatMessage({ id: 'classAndProperty.addPropertyValue.form.paltformValue' })}&nbsp;
<Tooltip title={intl.formatMessage({ id: 'classAndProperty.addPropertyValue.form.paltformValue.tooltip' })}>
<QuestionCircleOutlined />
</Tooltip>
</span>
}
>
<Row>
<Col span={20} style={{ display: 'none' }}><Form.Item name={['attributeValue', 'id']}><Input disabled /></Form.Item></Col>
<Col span={20}><Form.Item name={['attributeValue', 'value']}><Input disabled /></Form.Item></Col>
<Col span={4}>
<Button type="primary" icon={<LinkOutlined />} style={{ backgroundColor: '#909399', borderColor: '#909399' }} onClick={handleLink} disabled={isSee}>
{intl.formatMessage({ id: 'classAndProperty.addPropertyValue.form.paltformValue.button' })}
</Button>
</Col>
</Row>
</Form.Item>
</Col>
{
!isMultiple && <Col span={18}>
<Form.Item
label={
<span>
{intl.formatMessage({ id: 'classAndProperty.addPropertyValue.form.paltformValue' })}&nbsp;
<Tooltip title={intl.formatMessage({ id: 'classAndProperty.addPropertyValue.form.paltformValue.tooltip' })}>
<QuestionCircleOutlined />
</Tooltip>
</span>
}
>
<Row>
<Col span={20} style={{ display: 'none' }}><Form.Item name={['attributeValue', 'id']}><Input disabled /></Form.Item></Col>
<Col span={20}><Form.Item name={['attributeValue', 'value']}><Input disabled /></Form.Item></Col>
<Col span={4}>
<Button type="primary" icon={<LinkOutlined />} style={{ backgroundColor: '#909399', borderColor: '#909399' }} onClick={handleLink} disabled={isSee}>
{intl.formatMessage({ id: 'classAndProperty.addPropertyValue.form.paltformValue.button' })}
</Button>
</Col>
</Row>
</Form.Item>
</Col>
}
<Col span={18}>
<Form.Item
name='attributeName'
......
......@@ -400,7 +400,7 @@ const PropertyValue: React.FC<{}> = () => {
type="primary"
icon={<PlusOutlined />}
onClick={() => {
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/add?attrId=${selectKey || history.location.query.attrId}&attrName=${selectNode?._title || history.location.query.attrName}&type=${selectNode?.type || history.location.query.type}`)
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/add?attrId=${selectKey || history.location.query.attrId}&attrName=${selectNode?._title || history.location.query.attrName}&type=${selectNode?.type || history.location.query.type}&isMultiple=${isMultiple}`)
}}
>
{intl.formatMessage({ id: 'classAndProperty.propertyValue.standardTable.formilyChilds.button' })}
......
......@@ -366,6 +366,10 @@ const AddProducts: React.FC<{}> = (props) => {
setIsDisableSaveBtn(false)
message.error(e.message || intl.formatMessage({ id: 'commodity.products.addProducts.onSave.error.2' }))
}
// 新增不先填价格 清空属性form
if(childFormRefs.current[1].current.__INTERNAL__.name === 'attribute-form' && !productInfoByEdit) {
childFormRefs.current[1].current.resetFields()
}
console.log(e, 'e')
}).catch(error => {
console.log(error, '_error')
......
......@@ -201,7 +201,7 @@ const DirectChannel: React.FC<{}> = () => {
})
},
onCancel() {
console.log('Cancel');
console.log('Cancel')
},
})
else
......
......@@ -271,7 +271,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData, setCouponModalVisible })
{
!creditsCommodity && <Col span={2}>
<div>{intl.formatMessage({ id: 'transaction_components.jifendikou' })}</div>
<div>{`-${deductionAmount}`}</div>
<div>{`-${intl.formatMessage({ id: 'common.money' })}${deductionAmount}`}</div>
</Col>
}
{
......
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