Commit 4035f0b8 authored by 武广's avatar 武广

fix: 修改拉取jd图片按钮禁用问题和选规格自动生成数据

parent f698043e
import React, { useState } from 'react'; import React from 'react';
import { Select, Form, InputNumber, Input, Button, Popover } from 'antd'; import { Select, Form, InputNumber, Input, Button, Popover } from 'antd';
import commonStyle from '../common.less'; import commonStyle from '../common.less';
...@@ -108,7 +108,12 @@ export const CreateFormInput = props => { ...@@ -108,7 +108,12 @@ export const CreateFormInput = props => {
return ( return (
<> <>
{record.skuLink && ( {record.skuLink && (
<Button type="primary" size="small" onClick={() => onClickEvent('cloneImg', record)}> <Button
type="primary"
size="small"
disabled={props.disabled}
onClick={() => onClickEvent('cloneImg', record)}
>
拉图片 拉图片
</Button> </Button>
)} )}
......
...@@ -58,7 +58,7 @@ const SpecificationTemplate = (props, _) => { ...@@ -58,7 +58,7 @@ const SpecificationTemplate = (props, _) => {
const handleChange = (val, option) => { const handleChange = (val, option) => {
const optionSpecName = option ? option.specName : null; const optionSpecName = option ? option.specName : null;
form.setFieldsValue({ [selectName]: optionSpecName }); form.setFieldsValue({ [selectName]: optionSpecName });
// onChange(); onChange();
}; };
const inputOnblurEvent = event => { const inputOnblurEvent = event => {
...@@ -113,8 +113,9 @@ const SpecificationTemplate = (props, _) => { ...@@ -113,8 +113,9 @@ const SpecificationTemplate = (props, _) => {
{fields.map((field, index) => ( {fields.map((field, index) => (
<Form.Item key={field.key} noStyle shouldUpdate={(prevValues, curValues) => false}> <Form.Item key={field.key} noStyle shouldUpdate={(prevValues, curValues) => false}>
{() => ( {() => (
<Space key={field.key} align="baseline"> <Space key={`space_${field.key}`} align="baseline">
<Form.Item <Form.Item
key={`item_${field.key}`}
style={{ marginLeft: 10 }} style={{ marginLeft: 10 }}
name={[field.name, specName]} name={[field.name, specName]}
rules={[ rules={[
...@@ -142,6 +143,7 @@ const SpecificationTemplate = (props, _) => { ...@@ -142,6 +143,7 @@ const SpecificationTemplate = (props, _) => {
</Form.Item> </Form.Item>
{!(specDataList[index] && specDataList[index].id) && ( {!(specDataList[index] && specDataList[index].id) && (
<MinusCircleOutlined <MinusCircleOutlined
key={`minus_${field.key}`}
onClick={() => bundlePlusRemoveSpecEvent(remove, field.name)} onClick={() => bundlePlusRemoveSpecEvent(remove, field.name)}
/> />
)} )}
...@@ -150,7 +152,7 @@ const SpecificationTemplate = (props, _) => { ...@@ -150,7 +152,7 @@ const SpecificationTemplate = (props, _) => {
</Form.Item> </Form.Item>
))} ))}
{fields.length < 3 && (!customer.isEdit || customer.isCard) && ( {fields.length < 3 && (!customer.isEdit || customer.isCard) && (
<Form.Item noStyle> <Form.Item noStyle key="btnpush">
<Button <Button
style={{ marginLeft: 10, marginBottom: 24 }} style={{ marginLeft: 10, marginBottom: 24 }}
type="dashed" type="dashed"
......
...@@ -260,6 +260,7 @@ export const StaticColumns = customer => [ ...@@ -260,6 +260,7 @@ export const StaticColumns = customer => [
inputType: 'option', inputType: 'option',
roleProps: { roleProps: {
isJDGoods: customer.isJDGoods, isJDGoods: customer.isJDGoods,
disabled: customer.isEdit && !customer.isCard,
min: 0, min: 0,
}, },
roleRules: { required: false }, roleRules: { required: false },
......
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