Commit 3f82ac25 authored by beisir's avatar beisir

fix: 添加输入框pleaholder

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