Commit 52fbbe9b authored by 张子雨's avatar 张子雨

feat: 修复已知问题

parent c8e37188
......@@ -15,10 +15,11 @@ const TempleatModal = props => {
templateList,
isALL,
isType,
total,
} = props;
const formItemLayout = {
labelCol: {
span: 5,
span: 6,
},
wrapperCol: {
span: 16,
......@@ -85,12 +86,22 @@ const TempleatModal = props => {
onOk={() => handleOk()}
>
{!isALL && <p>已选择{selectedRowKeys.length}个商品</p>}
{isALL > 0 && isType === 'after' && <p>已选择{total}个商品</p>}
<Form {...formItemLayout}>
<Form.Item label="选择模板">
<Form.Item label={isType === 'after' ? '选择售后地址' : '选择模板'}>
{getFieldDecorator('templateId', {
rules: [{ required: true, message: '请选择模板!' }],
rules: [
{
required: true,
message: `${isType === 'after' ? '请选择售后地址' : '请选择模板'}`,
},
],
})(
<Select placeholder="请选择模板" labelInValue allowClear>
<Select
placeholder={isType === 'after' ? '选择售后地址' : '选择模板'}
labelInValue
allowClear
>
{isType === 'distribution' &&
templateList.map(item => (
<Option label={item.templateName} value={item.id} key={item.id}>
......
......@@ -83,7 +83,6 @@ class goodsManage extends Component {
// 获取售后地址
getAfterAddressData = async () => {
const data = await queryAllAfterAddress();
console.log(data);
if (data) {
this.setState({ afterAddressList: data.data.records });
}
......@@ -137,7 +136,6 @@ class goodsManage extends Component {
i.imageList = colorImg[i.firstSpecValue];
return i;
});
console.log(editData);
this.setState(
() => ({ colorImg, editData }),
() => {
......@@ -360,8 +358,12 @@ class goodsManage extends Component {
specListData,
} = this.props;
const { editData, productType } = this.state;
validateFields(async (errors, values) => {
if (!values.afterAddressId) {
notification.error({
message: '请选择售后地址',
});
}
let imgErr = false;
if (!errors) {
if (validateSpuInfo(values, initData, editData, productType)) return;
......
......@@ -294,7 +294,6 @@ class goodsManage extends Component {
const {
goodsManage: { tableData = {} },
} = this.props;
const rowSelection = {
selectedRowKeys: this.state.selectedRowKeys,
onChange: this.onSelectChange,
......@@ -390,6 +389,7 @@ class goodsManage extends Component {
<TempleatModal
visible={this.state.templeatModalVisible}
selectedRowKeys={this.state.selectedRowKeys}
total={tableData.total || 0}
onCancel={() => {
this.setState({ templeatModalVisible: false, selectedRowKeys: [] });
this.handleSearch();
......
......@@ -48,7 +48,6 @@ const ImageInfo = file =>
file.width = width;
file.height = height;
file.LtMB = LtMB;
console.log(file);
resolve(file);
});
image.addEventListener('error', () => {
......
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