Browse Source

增加发货管理功能

zhanghe 7 years ago
parent
commit
ae57ac5705

+ 1 - 1
src/components/DataSearch/index.js

@@ -106,7 +106,7 @@ export default class DataSearch extends PureComponent {
       <Input.Group compact size={size} className={styles.search} style={style}>
         {select && (
         <Select onChange={this.handleSelectChange} size={size} {...selectProps}>
-          {selectOptions && selectOptions.map((item, key) => <Option value={item.value} key={key}>{item.name || item.value}</Option>)}
+          {selectOptions && selectOptions.map((item, key) => <Select.Option value={item.value} key={key}>{item.name || item.value}</Select.Option>)}
         </Select>
 )}
         {this.renderKeyWordComponent()}

+ 1 - 1
src/layouts/BasicLayout.js

@@ -130,7 +130,7 @@ class BasicLayout extends React.PureComponent {
                     />
                   ))
                 }
-                <Redirect exact from="/" to="/sold" />
+                <Redirect exact from="/" to="/products" />
                 <Route render={NotFound} />
               </Switch>
             </div>

+ 1 - 1
src/models/login.js

@@ -15,7 +15,7 @@ export default {
       if (success) {
         message.success('登录成功');
         addLocalUser(data);
-        yield put(routerRedux.push('/sold'));
+        yield put(routerRedux.push('/products'));
       }
       yield put({ type: 'save', payload: { loading: false } });
     },

+ 18 - 0
src/routes/Merchant/index.js

@@ -61,6 +61,24 @@ export default class MerchantInfo extends PureComponent {
         <Spin spinning={loading}>
           <Card>
             <Form layout="horizontal" onSubmit={this.handlePageSubmit}>
+              <Form.Item label="厂商名称" hasFeedback {...formItemLayout}>
+                {getFieldDecorator('name', {
+                  rules: [{ required: true, type: 'string', message: '名称为必填项!' }],
+                  initialValue: item.name,
+                })(<Input />)}
+              </Form.Item>
+              <Form.Item label="联系人" hasFeedback {...formItemLayout}>
+                {getFieldDecorator('contactName', {
+                  rules: [{ required: true, type: 'string', message: '联系人为必填项!' }],
+                  initialValue: item.contactName,
+                })(<Input />)}
+              </Form.Item>
+              <Form.Item label="联系电话" hasFeedback {...formItemLayout}>
+                {getFieldDecorator('mobile', {
+                  rules: [{ required: true, type: 'string', message: '联系电话为必填项!' }],
+                  initialValue: item.mobile,
+                })(<Input />)}
+              </Form.Item>
               <Form.Item label="开户银行" hasFeedback {...formItemLayout}>
                 {getFieldDecorator('depositBank', {
                   rules: [{ required: true, type: 'string', message: '开户银行为必填项!' }],

+ 8 - 8
src/routes/Product/List/table.js

@@ -17,13 +17,13 @@ export default class TableList extends PureComponent {
       title: '产品名称',
       dataIndex: 'name',
       key: 'name',
-      width: '30%',
+      width: '35%',
     }, {
       title: '产品类型',
       dataIndex: 'type',
       key: 'type',
       render: text => productType[text],
-      width: '20%',
+      width: '25%',
     }, {
       title: '产品状态',
       dataIndex: 'status',
@@ -33,12 +33,12 @@ export default class TableList extends PureComponent {
         return (<Badge status={statusMap[record.status]} text={statuses[record.status]} />);
       },
       width: '15%',
-    }, {
-      title: '操作',
-      dataIndex: 'operation',
-      key: 'operation',
-      render: (text, record) => <a onClick={() => onViewItem(record)}>查看</a>,
-      width: '5%',
+    // }, {
+    //   title: '操作',
+    //   dataIndex: 'operation',
+    //   key: 'operation',
+    //   render: (text, record) => <a onClick={() => onViewItem(record)}>查看</a>,
+    //   width: '5%',
     }];
 
     // 配置分页

+ 4 - 4
src/routes/SoldProduct/index.js

@@ -10,7 +10,7 @@ import {
   Button,
 } from 'antd';
 import moment from 'moment';
-import { productType } from '../../utils/config';
+import { productType, pageSize } from '../../utils/config';
 import styles from './index.less';
 
 @Form.create()
@@ -34,17 +34,17 @@ export default class SoldProductList extends Component {
   handleFilterSubmit = (e) => {
     e.preventDefault();
     const filters = this.getFormValue();
-    this.props.dispatch({ type: 'snapshot/query', payload: filters });
+    this.props.dispatch({ type: 'snapshot/query', payload: { ...filters, pageSize } });
   }
 
   handleFilterReset = () => {
     this.props.form.resetFields();
-    this.props.dispatch({ type: 'snapshot/query', payload: {} });
+    this.props.dispatch({ type: 'snapshot/query', payload: { pageSize } });
   }
 
   handleTableChange = (pagination) => {
     const filters = { ...this.getFormValue(), ...pagination };
-    this.props.dispatch({ type: 'snapshot/query', payload: filters });
+    this.props.dispatch({ type: 'snapshot/query', payload: { ...filters, pageSize } });
   }
 
   render() {

+ 0 - 1
src/utils/request.js

@@ -108,4 +108,3 @@ export default function request(url, options) {
     .then(apiErrorHandler)
     .catch(e => ({ e }));
 }
-