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

feat: 修复已知问题

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