Commit 3f82ac25 authored by beisir's avatar beisir

fix: 添加输入框pleaholder

parent 4b842556
...@@ -343,7 +343,11 @@ class goodsManage extends Component { ...@@ -343,7 +343,11 @@ class goodsManage extends Component {
if (validateSpuInfo(values, initData, editData, productType)) return; if (validateSpuInfo(values, initData, editData, productType)) return;
editData.forEach(item => { editData.forEach(item => {
item.productStockWarning = item.productStockWarning < 0 ? 0 : item.productStockWarning; item.productStockWarning = item.productStockWarning < 0 ? 0 : item.productStockWarning;
item.imageList = values?.imageList[item.firstSpecValue] || values.commonImageList || []; if (values?.imageList) {
item.imageList = values?.imageList[item.firstSpecValue] || values.commonImageList;
} else {
item.imageList = values.commonImageList || [];
}
if (!item.imageList || !item.imageList.length) { if (!item.imageList || !item.imageList.length) {
imgErr = true; imgErr = true;
} }
...@@ -434,6 +438,13 @@ class goodsManage extends Component { ...@@ -434,6 +438,13 @@ class goodsManage extends Component {
this.BatchSetting.props.form.resetFields(); this.BatchSetting.props.form.resetFields();
}; };
validateToInputName = (rule, value, callback) => {
if (value.trim().length < 2) {
callback(new Error('商品名称不可小于2个字符'));
}
callback();
};
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;
...@@ -550,8 +561,9 @@ class goodsManage extends Component { ...@@ -550,8 +561,9 @@ class goodsManage extends Component {
<SuperSelect <SuperSelect
allowClear allowClear
showSearch showSearch
style={{ width: 190 }} style={{ width: 280 }}
filterOption={filterOption} filterOption={filterOption}
placeholder="请选择,支持模糊搜索"
> >
{brandListArray?.length && {brandListArray?.length &&
brandListArray.map(item => ( brandListArray.map(item => (
...@@ -563,6 +575,9 @@ class goodsManage extends Component { ...@@ -563,6 +575,9 @@ class goodsManage extends Component {
)} )}
</FormItem> </FormItem>
</Col> </Col>
<span style={{ display: 'inline-block', lineHeight: '35px', color: '#999' }}>
若需新增品牌请联系业务员
</span>
</Row> </Row>
<Row type="flex"> <Row type="flex">
<Col span={24}> <Col span={24}>
...@@ -570,13 +585,24 @@ class goodsManage extends Component { ...@@ -570,13 +585,24 @@ class goodsManage extends Component {
<FormItem label="商品名称" labelCol={{ span: 2 }}> <FormItem label="商品名称" labelCol={{ span: 2 }}>
{getFieldDecorator('name', { {getFieldDecorator('name', {
initialValue: initData.name, initialValue: initData.name,
validateTrigger: ['onBlur'],
rules: [ rules: [
{ {
required: true, required: true,
message: '请输入商品名称', message: '请输入商品名称',
}, },
{
validator: this.validateToInputName,
},
], ],
})(<Input style={{ width: 690 }} allowClear />)} })(
<Input
style={{ width: 690 }}
maxLength="100"
placeholder="请输入商品名称"
allowClear
/>,
)}
</FormItem> </FormItem>
</Popover> </Popover>
{isJDGoods && ( {isJDGoods && (
...@@ -597,6 +623,7 @@ class goodsManage extends Component { ...@@ -597,6 +623,7 @@ class goodsManage extends Component {
allowClear allowClear
showSearch showSearch
style={{ width: 200 }} style={{ width: 200 }}
placeholder="请选择一级规格"
disabled={isEdit && initData.firstSpecId} disabled={isEdit && initData.firstSpecId}
onChange={(val, option) => onChange={(val, option) =>
this.specChange('first', option?.props.children, val) this.specChange('first', option?.props.children, val)
...@@ -676,6 +703,7 @@ class goodsManage extends Component { ...@@ -676,6 +703,7 @@ class goodsManage extends Component {
allowClear allowClear
showSearch showSearch
disabled={isEdit && initData.secondSpecId} disabled={isEdit && initData.secondSpecId}
placeholder="请选择二级规格"
style={{ width: 200 }} style={{ width: 200 }}
onChange={(val, option) => this.specChange('second', option?.props.children)} onChange={(val, option) => this.specChange('second', option?.props.children)}
filterOption={(input, option) => filterOption={(input, option) =>
......
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