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

feat: 修改回显问题

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