Commit 5dc17ec6 authored by 张子雨's avatar 张子雨

feat: 修改回显问题

parent 894c5e96
......@@ -338,7 +338,6 @@ class goodsManage extends Component {
const { editData, productType } = this.state;
validateFields(async (errors, values) => {
console.log(values);
let imgErr = false;
if (!errors) {
if (validateSpuInfo(values, initData, editData, productType)) return;
......@@ -462,10 +461,8 @@ class goodsManage extends Component {
render() {
const { visible, form, initData = {}, treeData, virtualTreeData, specListData } = this.props;
const isEdit = Object.keys(initData).length !== 0;
// 是否仅编辑卖点和服务
const isService = initData.state && initData.state !== 4;
console.log(isService);
const { getFieldDecorator, getFieldsValue } = form;
getFieldDecorator('firstKeys', { initialValue: [] });
getFieldDecorator('secondKeys', { initialValue: [] });
......@@ -652,16 +649,17 @@ class goodsManage extends Component {
)}
</FormItem>
</Col>
{specListData.length &&
specListData.map((item, index) => (
<Col span={24}>
<FormItem label={item.specName} labelCol={{ span: 2 }}>
{getFieldDecorator(`${item.specId}`, {
initialValue: `initData.${item.specId}`,
})(<Checkbox.Group options={item.specValues} />)}
</FormItem>
</Col>
))}
{specListData.length
? specListData.map((item, index) => (
<Col span={24}>
<FormItem label={item.specName} labelCol={{ span: 2 }}>
{getFieldDecorator(`${item.specId}`, {
initialValue: initData[item.specId],
})(<Checkbox.Group options={item.specValues} />)}
</FormItem>
</Col>
))
: ''}
</Row>
</Card>
<Card className={styles.card} bordered={false}>
......
......@@ -130,9 +130,14 @@ class goodsManage extends Component {
data.secondSpecList.push(i.secondSpecValue);
}
});
data.specs.forEach(item => {
data[item.specId] = item.specValues;
const arr = [];
if (item.specValues.length) {
item.specValues.forEach(childItem => {
arr.push(childItem.value);
});
}
data[item.specId] = arr;
});
data.imageList = [];
data.carouseList.forEach(i => {
......
......@@ -140,7 +140,7 @@ export function column() {
render: (_, row) => (
<div>
<p>{row.state >= 5 ? '审核通过' : _}</p>
<p>{row.updateState || '_ _'}</p>
<p>{row.updateStateDesc || '_ _'}</p>
</div>
),
},
......
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