Commit 30297ba1 authored by lxd's avatar lxd

Merge branch 'feature/upgrade' of git.quantgroup.cn:ui/merchant-manage-ui into feature/upgrade

parents e82e995b a2d6b627
...@@ -85,6 +85,9 @@ class goodsManage extends Component { ...@@ -85,6 +85,9 @@ class goodsManage extends Component {
inputChange = (value, key, index) => { inputChange = (value, key, index) => {
this.setState(prev => { this.setState(prev => {
if (key === 'third') {
prev.editData[index].thirdSkuNo = value;
}
prev.editData[index][key] = value; prev.editData[index][key] = value;
return { editData: prev.editData }; return { editData: prev.editData };
}); });
...@@ -119,6 +122,7 @@ class goodsManage extends Component { ...@@ -119,6 +122,7 @@ class goodsManage extends Component {
i.imageList = colorImg[i.firstSpecValue]; i.imageList = colorImg[i.firstSpecValue];
return i; return i;
}); });
console.log(editData);
this.setState( this.setState(
() => ({ colorImg, editData }), () => ({ colorImg, editData }),
() => { () => {
...@@ -159,6 +163,9 @@ class goodsManage extends Component { ...@@ -159,6 +163,9 @@ class goodsManage extends Component {
form: { setFieldsValue }, form: { setFieldsValue },
initData, initData,
} = this.props; } = this.props;
initData.editData.forEach(item => {
item.third = item.thirdSkuNo;
});
if (Object.keys(initData).length) { if (Object.keys(initData).length) {
this.setState({ this.setState({
initForm: initData, initForm: initData,
...@@ -572,7 +579,7 @@ class goodsManage extends Component { ...@@ -572,7 +579,7 @@ class goodsManage extends Component {
style={{ background: '#fff', borderRadius: '6px', padding: '20px 0 5px 0' }} style={{ background: '#fff', borderRadius: '6px', padding: '20px 0 5px 0' }}
> >
<Col span={10}> <Col span={10}>
<FormItem label="商品品牌" {...formItemLayout}> <FormItem label="商品品牌" {...formItemLayout}>
{getFieldDecorator('brandId', { {getFieldDecorator('brandId', {
initialValue: this.state.initForm.brandId, initialValue: this.state.initForm.brandId,
rules: [ rules: [
...@@ -607,7 +614,7 @@ class goodsManage extends Component { ...@@ -607,7 +614,7 @@ class goodsManage extends Component {
<Row type="flex"> <Row type="flex">
<Col span={24}> <Col span={24}>
<Popover content={name} trigger="hover"> <Popover content={name} trigger="hover">
<FormItem label="商品名称" labelCol={{ span: 2 }}> <FormItem label="商品名称" labelCol={{ span: 2 }}>
{getFieldDecorator('name', { {getFieldDecorator('name', {
initialValue: initData.name, initialValue: initData.name,
validateTrigger: ['onBlur'], validateTrigger: ['onBlur'],
...@@ -638,7 +645,7 @@ class goodsManage extends Component { ...@@ -638,7 +645,7 @@ class goodsManage extends Component {
)} )}
</Col> </Col>
<Col span={24}> <Col span={24}>
<FormItem label="商品卖点" labelCol={{ span: 2 }}> <FormItem label="商品卖点" labelCol={{ span: 2 }}>
{getFieldDecorator('character', { {getFieldDecorator('character', {
initialValue: initData.character, initialValue: initData.character,
})( })(
...@@ -857,76 +864,74 @@ class goodsManage extends Component { ...@@ -857,76 +864,74 @@ class goodsManage extends Component {
/> />
</Row> </Row>
<Row> <Row>
<Button <Col span={24}>
type="danger" <Button
size="small" type="danger"
onClick={this.deleteImg} size="small"
style={{ marginTop: '10px' }} onClick={this.deleteImg}
icon={<RestOutlined />} style={{ marginTop: '10px' }}
> icon={<RestOutlined />}
图片批量删除 >
</Button> 图片批量删除
<Row> </Button>
<Col span={1}> </Col>
<Checkbox <Col span={1}>
value="commonImageList" <Checkbox
checked={this.state.batchDeleteImgObj.commonImageList} value="commonImageList"
style={{ marginTop: '12px' }} checked={this.state.batchDeleteImgObj.commonImageList}
onChange={() => this.chooseRollImg('commonImageList')} style={{ marginTop: '12px' }}
></Checkbox> onChange={() => this.chooseRollImg('commonImageList')}
</Col> ></Checkbox>
<Col span={23} className={styles.imgBorder}> </Col>
<FormItem label="公共滑动图"> <Col span={23} className={styles.imgBorder}>
{getFieldDecorator('commonImageList', { <FormItem label="公共滑动图">
initialValue: this.state.initForm.commonImageList, {getFieldDecorator('commonImageList', {
valuePropName: 'fileList', initialValue: this.state.initForm.commonImageList,
getValueFromEvent: normFile, valuePropName: 'fileList',
})(<Upload isDisabled={isService} />)} getValueFromEvent: normFile,
</FormItem> })(<Upload isDisabled={isService} />)}
</Col> </FormItem>
</Row> </Col>
{colorKeys.length > 0 && {colorKeys.length > 0 &&
colorKeys.map(color => { colorKeys.map(color => {
if (JSON.stringify(color) === '{}') return []; if (JSON.stringify(color) === '{}') return [];
if ((color !== null && !color) || (color && !color.trim())) return []; if ((color !== null && !color) || (color && !color.trim())) return [];
return [ return [
<Row> <Col span={1}>
<Col span={1}> <Checkbox
<Checkbox value={color}
value={color} checked={this.state.batchDeleteImgObj[color]}
checked={this.state.batchDeleteImgObj[color]} style={{ marginTop: '12px' }}
style={{ marginTop: '12px' }} onChange={() => this.chooseRollImg(color)}
onChange={() => this.chooseRollImg(color)} ></Checkbox>
></Checkbox> </Col>,
</Col> <Col span={23} className={styles.imgBorder}>
<Col span={23} className={styles.imgBorder}> <FormItem
<FormItem key={color}
key={color} label={`滑动图${color === 'null' ? '' : `(${color})`}:`}
label={`滑动图${color === 'null' ? '' : `(${color})`}:`} >
{getFieldDecorator(`imageList[${color}]`, {
initialValue:
this.state.initForm.imageList && this.state.initForm.imageList[color],
valuePropName: 'fileList',
getValueFromEvent: normFile,
})(
<Upload
isDisabled={isService}
onChange={val => this.imgChange(val, color)}
/>,
)}
<Button
disabled={colorImg[color]?.length}
size="small"
type="primary"
className={styles.pullBtn}
onClick={() => this.pullImg(commonImageList, color)}
> >
{getFieldDecorator(`imageList[${color}]`, { 拉取公共图像
initialValue: </Button>
this.state.initForm.imageList && this.state.initForm.imageList[color], </FormItem>
valuePropName: 'fileList', </Col>,
getValueFromEvent: normFile,
})(
<Upload
isDisabled={isService}
onChange={val => this.imgChange(val, color)}
/>,
)}
<Button
disabled={colorImg[color]?.length}
size="small"
type="primary"
className={styles.pullBtn}
onClick={() => this.pullImg(commonImageList, color)}
>
拉取公共图像
</Button>
</FormItem>
</Col>
</Row>,
]; ];
})} })}
</Row> </Row>
......
...@@ -279,15 +279,15 @@ export function editColumns( ...@@ -279,15 +279,15 @@ export function editColumns(
{ {
title: '商品自编码', title: '商品自编码',
align: 'center', align: 'center',
key: 'thirdSkuNo', dataIndex: 'third',
dataIndex: 'thirdSkuNo', key: 'third',
width: 100, width: 100,
render: (val, row, index) => ( render: (val, row, index) => (
<Input <Input
value={val} value={val}
className={`thirdSkuNo ${index}`} className={`third ${index}`}
defaultValue={val} defaultValue={val}
onChange={evt => inputChange(evt.target.value, 'thirdSkuNo', index)} onChange={evt => inputChange(evt.target.value, 'third', index)}
disabled={isService} disabled={isService}
/> />
), ),
......
...@@ -151,7 +151,7 @@ export function column() { ...@@ -151,7 +151,7 @@ export function column() {
align: 'center', align: 'center',
render: (_, row) => ( render: (_, row) => (
<div className={styles.actionBtn}> <div className={styles.actionBtn}>
{(row.state === 4 || (row.state === 5 && row.updateState !== 1)) && ( {(row.state === 4 || (row.state >= 5 && row.updateState !== 1)) && (
<Button <Button
key="edit" key="edit"
type="primary" type="primary"
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
} }
.pullBtn { .pullBtn {
position: absolute; position: absolute;
top: -30px; top: 30px;
left: 700px; right: -700px;
} }
.price { .price {
......
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