Commit 70238242 authored by 张子雨's avatar 张子雨

feat: 商品审核完成

parent deb89830
...@@ -81,6 +81,7 @@ class goodsManage extends Component { ...@@ -81,6 +81,7 @@ class goodsManage extends Component {
secondSpesName = '', secondSpesName = '',
productType, productType,
isEdit, isEdit,
isService,
} = this.props; } = this.props;
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
return ( return (
...@@ -171,7 +172,7 @@ class goodsManage extends Component { ...@@ -171,7 +172,7 @@ class goodsManage extends Component {
</FormItem> </FormItem>
)} )}
<FormItem> <FormItem>
<Button type="primary" htmlType="submit" onClick={this.batchSetting}> <Button type="primary" htmlType="submit" onClick={this.batchSetting} disabled={isService}>
批量设置 批量设置
</Button> </Button>
</FormItem> </FormItem>
......
...@@ -450,6 +450,8 @@ class goodsManage extends Component { ...@@ -450,6 +450,8 @@ class goodsManage extends Component {
render() { render() {
const { visible, form, initData = {}, treeData, virtualTreeData } = this.props; const { visible, form, initData = {}, treeData, virtualTreeData } = this.props;
const isEdit = Object.keys(initData).length !== 0; const isEdit = Object.keys(initData).length !== 0;
// 是否仅编辑卖点和服务
const isService = initData.state === 5;
const { getFieldDecorator, getFieldsValue } = form; const { getFieldDecorator, getFieldsValue } = form;
getFieldDecorator('firstKeys', { initialValue: [] }); getFieldDecorator('firstKeys', { initialValue: [] });
getFieldDecorator('secondKeys', { initialValue: [] }); getFieldDecorator('secondKeys', { initialValue: [] });
...@@ -538,7 +540,7 @@ class goodsManage extends Component { ...@@ -538,7 +540,7 @@ class goodsManage extends Component {
fieldNames={{ label: 'name', value: 'id', children: 'children' }} fieldNames={{ label: 'name', value: 'id', children: 'children' }}
options={treeDataArray} options={treeDataArray}
onChange={(val, label, ext) => this.treeChange(val, label, ext)} onChange={(val, label, ext) => this.treeChange(val, label, ext)}
// disabled={isEdit} disabled={isService}
/>, />,
)} )}
</FormItem> </FormItem>
...@@ -567,6 +569,7 @@ class goodsManage extends Component { ...@@ -567,6 +569,7 @@ class goodsManage extends Component {
style={{ width: 280 }} style={{ width: 280 }}
filterOption={filterOption} filterOption={filterOption}
placeholder="请选择商品品牌,支持模糊搜索" placeholder="请选择商品品牌,支持模糊搜索"
disabled={isService}
> >
{brandListArray?.length && {brandListArray?.length &&
brandListArray.map(item => ( brandListArray.map(item => (
...@@ -604,6 +607,7 @@ class goodsManage extends Component { ...@@ -604,6 +607,7 @@ class goodsManage extends Component {
maxLength="100" maxLength="100"
placeholder="请输入商品名称" placeholder="请输入商品名称"
allowClear allowClear
disabled={isService}
/>, />,
)} )}
</FormItem> </FormItem>
...@@ -788,6 +792,7 @@ class goodsManage extends Component { ...@@ -788,6 +792,7 @@ class goodsManage extends Component {
type="primary" type="primary"
className={styles.logBtn} className={styles.logBtn}
onClick={() => this.createShopInfo(isEdit)} onClick={() => this.createShopInfo(isEdit)}
disabled={isService}
> >
生成商品信息 生成商品信息
</Button> </Button>
...@@ -805,6 +810,7 @@ class goodsManage extends Component { ...@@ -805,6 +810,7 @@ class goodsManage extends Component {
productType={productType} productType={productType}
isEdit={isEdit} isEdit={isEdit}
isJDGoods={isJDGoods} isJDGoods={isJDGoods}
isService={isService}
/> />
<Row> <Row>
<Table <Table
...@@ -825,6 +831,7 @@ class goodsManage extends Component { ...@@ -825,6 +831,7 @@ class goodsManage extends Component {
this.state.initForm.secondSpecName, this.state.initForm.secondSpecName,
isJDGoods, isJDGoods,
isEdit, isEdit,
isService,
)} )}
/> />
</Row> </Row>
...@@ -835,6 +842,7 @@ class goodsManage extends Component { ...@@ -835,6 +842,7 @@ class goodsManage extends Component {
onClick={this.deleteImg} onClick={this.deleteImg}
style={{ marginTop: '10px' }} style={{ marginTop: '10px' }}
icon="rest" icon="rest"
disabled={isService}
> >
图片批量删除 图片批量删除
</Button> </Button>
...@@ -853,7 +861,7 @@ class goodsManage extends Component { ...@@ -853,7 +861,7 @@ class goodsManage extends Component {
initialValue: this.state.initForm.commonImageList, initialValue: this.state.initForm.commonImageList,
valuePropName: 'fileList', valuePropName: 'fileList',
getValueFromEvent: normFile, getValueFromEvent: normFile,
})(<Upload />)} })(<Upload isDisabled={isService} />)}
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -861,7 +869,6 @@ class goodsManage extends Component { ...@@ -861,7 +869,6 @@ class goodsManage extends Component {
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 [];
// if (initData.) {}
return [ return [
<Row> <Row>
<Col span={1}> <Col span={1}>
...@@ -882,7 +889,12 @@ class goodsManage extends Component { ...@@ -882,7 +889,12 @@ class goodsManage extends Component {
this.state.initForm.imageList && this.state.initForm.imageList[color], this.state.initForm.imageList && this.state.initForm.imageList[color],
valuePropName: 'fileList', valuePropName: 'fileList',
getValueFromEvent: normFile, getValueFromEvent: normFile,
})(<Upload onChange={val => this.imgChange(val, color)} />)} })(
<Upload
isDisabled={isService}
onChange={val => this.imgChange(val, color)}
/>,
)}
<Button <Button
disabled={colorImg[color]?.length} disabled={colorImg[color]?.length}
size="small" size="small"
...@@ -919,7 +931,7 @@ class goodsManage extends Component { ...@@ -919,7 +931,7 @@ class goodsManage extends Component {
message: '请上传详情图', message: '请上传详情图',
}, },
], ],
})(<Upload />)} })(<Upload isDisabled={isService} />)}
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
......
...@@ -213,7 +213,15 @@ export function verify(initData, categoryId) { ...@@ -213,7 +213,15 @@ export function verify(initData, categoryId) {
return false; return false;
} }
export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods, isEdit) { export function editColumns(
methods,
firstData,
firstSpec,
secondSpec,
isJDGoods,
isEdit,
isService,
) {
const { getJdPicList, inputChange, openModal, productType } = methods; const { getJdPicList, inputChange, openModal, productType } = methods;
if (!firstData) return []; if (!firstData) return [];
...@@ -231,7 +239,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods ...@@ -231,7 +239,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
precision={2} precision={2}
min={0} min={0}
onChange={value => inputChange(value, 'supplyPrice', index)} onChange={value => inputChange(value, 'supplyPrice', index)}
disabled={isJDGoods} disabled={isJDGoods || isService}
/> />
), ),
}, },
...@@ -248,6 +256,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods ...@@ -248,6 +256,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
precision={2} precision={2}
min={0} min={0}
onChange={value => inputChange(value, 'marketPrice', index)} onChange={value => inputChange(value, 'marketPrice', index)}
disabled={isService}
/> />
), ),
}, },
...@@ -263,6 +272,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods ...@@ -263,6 +272,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
precision={0} precision={0}
min={0} min={0}
onChange={value => inputChange(value, 'productStock', index)} onChange={value => inputChange(value, 'productStock', index)}
disabled={isService}
/> />
), ),
}, },
...@@ -278,6 +288,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods ...@@ -278,6 +288,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
className={`thirdSkuNo ${index}`} className={`thirdSkuNo ${index}`}
defaultValue={val} defaultValue={val}
onChange={evt => inputChange(evt.target.value, 'thirdSkuNo', index)} onChange={evt => inputChange(evt.target.value, 'thirdSkuNo', index)}
disabled={isService}
/> />
), ),
}, },
...@@ -295,6 +306,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods ...@@ -295,6 +306,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
className={`skuLink ${index}`} className={`skuLink ${index}`}
defaultValue={val} defaultValue={val}
onChange={evt => inputChange(evt.target.value, 'skuLink', index)} onChange={evt => inputChange(evt.target.value, 'skuLink', index)}
disabled={isService}
/> />
} }
</Popover> </Popover>
...@@ -319,6 +331,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods ...@@ -319,6 +331,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
size="small" size="small"
style={{ marginTop: '5px' }} style={{ marginTop: '5px' }}
onClick={() => openModal(row, index)} onClick={() => openModal(row, index)}
disabled={isService}
> >
修改sku名称 修改sku名称
</Button> </Button>
...@@ -343,6 +356,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods ...@@ -343,6 +356,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
max={999999.999} max={999999.999}
precision={3} precision={3}
onChange={value => inputChange(value, 'weight', index)} onChange={value => inputChange(value, 'weight', index)}
disabled={isService}
/> />
), ),
}); });
...@@ -360,6 +374,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods ...@@ -360,6 +374,7 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
min={0} min={0}
precision={0} precision={0}
onChange={value => inputChange(value, 'productStockWarning', index)} onChange={value => inputChange(value, 'productStockWarning', index)}
disabled={isService}
/> />
), ),
}); });
......
...@@ -98,12 +98,13 @@ class goodsManage extends Component { ...@@ -98,12 +98,13 @@ class goodsManage extends Component {
this.handleSearch(); this.handleSearch();
}; };
onUpdateInfo = async ({ spuId, productType }) => { onUpdateInfo = async ({ state, spuId, productType }) => {
this.setState({ this.setState({
createloading: true, createloading: true,
}); });
const { data, msg } = await spuDetail({ id: spuId }); const { data, msg } = await spuDetail({ id: spuId });
if (data) { if (data) {
data.state = 5;
data.pageProductType = productType; data.pageProductType = productType;
data.categoryId = data.thirdCategoryId; data.categoryId = data.thirdCategoryId;
data.firstSpecId = data.skuList[0].firstSpecId; data.firstSpecId = data.skuList[0].firstSpecId;
......
...@@ -143,7 +143,7 @@ export function column() { ...@@ -143,7 +143,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 === 4 || row.state === 5) && (
<Button <Button
key="edit" key="edit"
type="primary" type="primary"
......
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
} }
.warning { .warning {
margin-top: -20px; margin-top: -20px;
margin-bottom: 20px;
color: red; color: red;
} }
......
...@@ -156,7 +156,7 @@ class PicturesWall extends React.Component { ...@@ -156,7 +156,7 @@ class PicturesWall extends React.Component {
<div className="ant-upload-text">上传图片</div> <div className="ant-upload-text">上传图片</div>
</div> </div>
); );
const { max } = this.props; const { max, isDisabled } = this.props;
const that = this; const that = this;
const uploadProps = { const uploadProps = {
beforeUpload: lodash.debounce(async (file, files) => { beforeUpload: lodash.debounce(async (file, files) => {
...@@ -218,11 +218,13 @@ class PicturesWall extends React.Component { ...@@ -218,11 +218,13 @@ class PicturesWall extends React.Component {
className={styles.maskIcon} className={styles.maskIcon}
onClick={() => this.handlePreview(item)} onClick={() => this.handlePreview(item)}
/> />
{!isDisabled && (
<Icon <Icon
type="delete" type="delete"
className={styles.maskIcon} className={styles.maskIcon}
onClick={() => this.onRemoveImg(item)} onClick={() => this.onRemoveImg(item)}
/> />
)}
</div> </div>
)} )}
</div> </div>
...@@ -230,7 +232,13 @@ class PicturesWall extends React.Component { ...@@ -230,7 +232,13 @@ class PicturesWall extends React.Component {
</ReactSortable> </ReactSortable>
)} )}
</div> </div>
<Upload multiple {...uploadProps} fileList={fileList} showUploadList={false}> <Upload
multiple
{...uploadProps}
fileList={fileList}
showUploadList={false}
disabled={isDisabled}
>
{max && fileList.length >= max ? null : uploadButton} {max && fileList.length >= max ? null : uploadButton}
</Upload> </Upload>
<Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}> <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
......
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