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