Browse Source

完善各模块,调试解决bug

zhanghe 7 years ago
parent
commit
f2ff7c7ed8

+ 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()}

+ 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: '开户银行为必填项!' }],

+ 9 - 9
src/routes/Order/Edit/SubOrderProfile.js

@@ -51,7 +51,7 @@ export default class SubOrderProfile extends Component {
     const { id } = currentItem;
     validateFields((errors) => {
       if (!errors) {
-        const trackNo = getFieldsValue(['tracKNo']);
+        const { trackNo } = getFieldsValue();
         dispatch({
           type: 'orderDetail/orderSend',
           payload: { id, trackNo },
@@ -95,13 +95,13 @@ export default class SubOrderProfile extends Component {
       //     </FooterToolbar>
       //   );
       // // 待收货订单
-      // case Codes.CODE_SENT:
-      //   return (
-      //     <FooterToolbar>
-      //       <Button onClick={this.handlePageCancel}>返回订单列表</Button>
-      //       <Button onClick={this.confirmReceipt} type="primary">确认收货</Button>
-      //     </FooterToolbar>
-      //   );
+      case Codes.CODE_SENT:
+        return (
+          <FooterToolbar>
+            <Button onClick={this.handlePageCancel}>返回订单列表</Button>
+            <Button onClick={this.confirmReceipt} type="primary">确认收货</Button>
+          </FooterToolbar>
+        );
       // 已完成订单
       case Codes.CODE_COMPLETE:
         return (
@@ -347,7 +347,7 @@ export default class SubOrderProfile extends Component {
         >
           <Form layout="horizontal">
             <Form.Item label="物流单号:" hasFeedback {...formItemLayout}>
-              {getFieldDecorator('code', {
+              {getFieldDecorator('trackNo', {
                 rules: [{ required: true, type: 'string', message: '请填写正确的物流单号!' }],
                 initialValue: trackNo,
               })(<Input placeholder="请填写物流单号" />)}

+ 9 - 5
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,21 @@ 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 });
+    const filters = {
+      ...this.getFormValue(),
+      pageNo: pagination.current,
+      pageSize: pagination.pageSize
+    };
+    this.props.dispatch({ type: 'snapshot/query', payload: { ...filters, pageSize } });
   }
 
   render() {

+ 1 - 0
src/utils/api.js

@@ -16,5 +16,6 @@ module.exports = {
   order: `${config.apiHost}/order`,
   subOrder: `${config.apiHost}/order/detail`,
   orderPay: `${config.apiHost}/order/pay`,
+  orderReceive: `${config.apiHost}/order/receive`,
   snapShot: `${config.apiHost}/order/snapshot`,
 };