Browse Source

去掉InputNumber前缀

zhanghe 7 years ago
parent
commit
7ece440078
3 changed files with 3 additions and 18 deletions
  1. 0 2
      src/routes/Combo/Edit/index.js
  2. 3 14
      src/routes/MProduct/Edit/price.js
  3. 0 2
      src/routes/Order/Add/index.js

+ 0 - 2
src/routes/Combo/Edit/index.js

@@ -213,8 +213,6 @@ export default class PackageProfile extends PureComponent {
           min={0}
           value={record.cpPrice}
           onChange={(value) => this.handleInputNumberChange(value, record)}
-          formatter={value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
-          parser={value => value.replace(/\¥\s?|(,*)/g, '')}
         />
       ),
       width: '28%',

+ 3 - 14
src/routes/MProduct/Edit/price.js

@@ -26,10 +26,6 @@ export default class NewPriceModal extends PureComponent {
     });
   }
 
-  handleTest = (value) => {
-    console.log(value);
-  }
-
   render() {
     const { form, data, onSubmit, ...modalProps } = this.props;
     const { getFieldDecorator } = form;
@@ -52,7 +48,7 @@ export default class NewPriceModal extends PureComponent {
               </Select>
             )}
           </Form.Item>
-          <Form.Item label="供应商价格" { ...formItemLayout }>
+          <Form.Item label="供应商价格(¥)" { ...formItemLayout }>
             {getFieldDecorator('cpPrice', {
               initialValue: data.cpPrice,
             })(
@@ -60,13 +56,10 @@ export default class NewPriceModal extends PureComponent {
                 min={0}
                 style={{ width: '80%' }}
                 placeholder="请填写"
-                onChange={this.handleTest}
-                formatter={value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
-                parser={value => value.replace(/\¥\s?|(,*)/g, '')}
               />
             )}
           </Form.Item>
-          <Form.Item label="渠道方价格" { ...formItemLayout }>
+          <Form.Item label="渠道方价格(¥)" { ...formItemLayout }>
             {getFieldDecorator('merchantPrice', {
               initialValue: data.merchantPrice,
             })(
@@ -74,12 +67,10 @@ export default class NewPriceModal extends PureComponent {
                 min={0}
                 style={{ width: '80%' }}
                 placeholder="请填写"
-                formatter={value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
-                parser={value => value.replace(/\¥\s?|(,*)/g, '')}
               />
             )}
           </Form.Item>
-          <Form.Item label="终端价格" { ...formItemLayout }>
+          <Form.Item label="终端价格(¥)" { ...formItemLayout }>
             {getFieldDecorator('terminalPrice', {
               initialValue: data.terminalPrice,
             })(
@@ -87,8 +78,6 @@ export default class NewPriceModal extends PureComponent {
                 min={0}
                 style={{ width: '80%' }}
                 placeholder="请填写"
-                formatter={value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
-                parser={value => value.replace(/\¥\s?|(,*)/g, '')}
               />
             )}
           </Form.Item>

+ 0 - 2
src/routes/Order/Add/index.js

@@ -345,8 +345,6 @@ export default class CreateOrder extends Component {
             <InputNumber
               min={1}
               value={record.goods.filter(item => item.selected)[0].quantity}
-              formatter={value => `x ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
-              parser={value => value.replace(/\x\s?|(,*)/g, '')}
             />
           );
         } else {