Commit 5dd50b67 authored by luoxiaodong's avatar luoxiaodong

升级版本

parent da4c606a
...@@ -9629,7 +9629,7 @@ ...@@ -9629,7 +9629,7 @@
}, },
"node_modules/antd-virtual-select": { "node_modules/antd-virtual-select": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "http://npmprivate.quantgroups.com/antd-virtual-select/-/antd-virtual-select-1.1.2.tgz", "resolved": "https://registry.npmjs.org/antd-virtual-select/-/antd-virtual-select-1.1.2.tgz",
"integrity": "sha512-GejZ/ihog9ZwSn16GsfABPBjeM/X9XMktndu570q9kCe1D/LieO07xNME/dLx4x8IaqGxh6yW4eTUzR83+gkKw==", "integrity": "sha512-GejZ/ihog9ZwSn16GsfABPBjeM/X9XMktndu570q9kCe1D/LieO07xNME/dLx4x8IaqGxh6yW4eTUzR83+gkKw==",
"dependencies": { "dependencies": {
"moment": "^2.22.2" "moment": "^2.22.2"
...@@ -43785,7 +43785,7 @@ ...@@ -43785,7 +43785,7 @@
}, },
"antd-virtual-select": { "antd-virtual-select": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "http://npmprivate.quantgroups.com/antd-virtual-select/-/antd-virtual-select-1.1.2.tgz", "resolved": "https://registry.npmjs.org/antd-virtual-select/-/antd-virtual-select-1.1.2.tgz",
"integrity": "sha512-GejZ/ihog9ZwSn16GsfABPBjeM/X9XMktndu570q9kCe1D/LieO07xNME/dLx4x8IaqGxh6yW4eTUzR83+gkKw==", "integrity": "sha512-GejZ/ihog9ZwSn16GsfABPBjeM/X9XMktndu570q9kCe1D/LieO07xNME/dLx4x8IaqGxh6yW4eTUzR83+gkKw==",
"requires": { "requires": {
"moment": "^2.22.2" "moment": "^2.22.2"
/* eslint-disable no-param-reassign */ /* eslint-disable no-param-reassign */
import { Form } from '@ant-design/compatible'; import { Form, Select, Input, InputNumber, Button } from 'antd';
import '@ant-design/compatible/assets/index.css';
import { Select, Input, InputNumber, Button } from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
// import styles from '../style.less'; // import styles from '../style.less';
...@@ -11,12 +8,14 @@ const { Option } = Select; ...@@ -11,12 +8,14 @@ const { Option } = Select;
const FormItem = Form.Item; const FormItem = Form.Item;
class goodsManage extends Component { class goodsManage extends Component {
formRef = React.createRef();
componentDidMount() { componentDidMount() {
this.props.onRef(this); this.props.onRef(this);
} }
setFiled = flag => { setFiled = flag => {
const { form } = this.props; const form = this.formRef.current;
if (flag === 'firstKeys') { if (flag === 'firstKeys') {
form.setFieldsValue({ firstSpecValue: '' }); form.setFieldsValue({ firstSpecValue: '' });
return; return;
...@@ -25,7 +24,8 @@ class goodsManage extends Component { ...@@ -25,7 +24,8 @@ class goodsManage extends Component {
}; };
batchSetting = () => { batchSetting = () => {
const { form, editData, isEdit } = this.props; const { editData, isEdit } = this.props;
const form = this.formRef.current;
const data = form.getFieldsValue(); const data = form.getFieldsValue();
if (!data.firstSpecValue && !data.secondSpecValue) { if (!data.firstSpecValue && !data.secondSpecValue) {
editData.forEach(item => { editData.forEach(item => {
...@@ -85,50 +85,41 @@ class goodsManage extends Component { ...@@ -85,50 +85,41 @@ class goodsManage extends Component {
productType, productType,
isEdit, isEdit,
} = this.props; } = this.props;
const { getFieldDecorator } = this.props.form;
return ( return (
<Form layout="inline" onSubmit={this.handleSubmit}> <Form layout="inline" ref={this.formRef}>
<FormItem> <FormItem name="firstSpecValue">
{getFieldDecorator('firstSpecValue', {})( <Select allowClear style={{ width: 120 }} placeholder={firstSpesName}>
<Select allowClear style={{ width: 120 }} placeholder={firstSpesName}> {firstSpes.length > 0 &&
{firstSpes.length > 0 && firstSpes.map(
firstSpes.map( item =>
item => item &&
item && typeof item === 'string' && (
typeof item === 'string' && ( <Option key={item} value={item}>
<Option key={item} value={item}> {item}
{item} </Option>
</Option> ),
), )}
)} </Select>
</Select>,
)}
</FormItem> </FormItem>
<FormItem> <FormItem name="secondSpecValue">
{getFieldDecorator('secondSpecValue', {})( <Select allowClear style={{ width: 120 }} placeholder={secondSpesName}>
<Select allowClear style={{ width: 120 }} placeholder={secondSpesName}> {secondSpecs.length &&
{secondSpecs.length && secondSpecs.map(
secondSpecs.map( item =>
item => item &&
item && typeof item === 'string' && (
typeof item === 'string' && ( <Option key={item} value={item}>
<Option key={item} value={item}> {item}
{item} </Option>
</Option> ),
), )}
)} </Select>
</Select>,
)}
</FormItem> </FormItem>
<FormItem> <FormItem name="supplyPrice">
{getFieldDecorator('supplyPrice', {})( <Input placeholder="供货价" style={{ width: 100 }} />
<Input placeholder="供货价" style={{ width: 100 }} />,
)}
</FormItem> </FormItem>
<FormItem> <FormItem name="marketPrice">
{getFieldDecorator('marketPrice', {})( <Input placeholder="市场价" style={{ width: 100 }} />
<Input placeholder="市场价" style={{ width: 100 }} />,
)}
</FormItem> </FormItem>
{/* <FormItem> {/* <FormItem>
{getFieldDecorator('salePrice', {})( {getFieldDecorator('salePrice', {})(
...@@ -136,41 +127,35 @@ class goodsManage extends Component { ...@@ -136,41 +127,35 @@ class goodsManage extends Component {
)} )}
</FormItem> */} </FormItem> */}
{productType === 1 && ( {productType === 1 && (
<FormItem> <FormItem name="weight">
{getFieldDecorator('weight', {})( <InputNumber
<InputNumber precision={3}
precision={3} max={999999.999}
max={999999.999} // eslint-disable-next-line radix
// eslint-disable-next-line radix placeholder="重量"
placeholder="重量" style={{ width: 130 }}
style={{ width: 130 }} />
/>,
)}
</FormItem> </FormItem>
)} )}
<FormItem> <FormItem name="productStock">
{getFieldDecorator('productStock', {})( <InputNumber
precision={0}
step={1}
// eslint-disable-next-line radix
formatter={val => parseInt(val, '10') || ''}
placeholder="库存"
style={{ width: 100 }}
/>
</FormItem>
{productType === 1 && (
<FormItem name="productStockWarning">
<InputNumber <InputNumber
placeholder="库存预警"
maxLength={5}
min={0}
precision={0} precision={0}
step={1}
// eslint-disable-next-line radix
formatter={val => parseInt(val, '10') || ''}
placeholder="库存"
style={{ width: 100 }} style={{ width: 100 }}
/>, />
)}
</FormItem>
{productType === 1 && (
<FormItem>
{getFieldDecorator('productStockWarning', {})(
<InputNumber
placeholder="库存预警"
maxLength={5}
min={0}
precision={0}
style={{ width: 100 }}
/>,
)}
</FormItem> </FormItem>
)} )}
<FormItem> <FormItem>
...@@ -183,4 +168,4 @@ class goodsManage extends Component { ...@@ -183,4 +168,4 @@ class goodsManage extends Component {
} }
} }
export default Form.create()(goodsManage); export default goodsManage;
import { MinusCircleOutlined, PlusOutlined, RestOutlined } from '@ant-design/icons'; /* eslint-disable no-param-reassign */
import { Form } from '@ant-design/compatible'; import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css'; import '@ant-design/compatible/assets/index.css';
import { import {
Modal, Modal,
...@@ -7,6 +8,7 @@ import { ...@@ -7,6 +8,7 @@ import {
Button, Button,
Select, Select,
Input, Input,
Icon,
Row, Row,
Col, Col,
Checkbox, Checkbox,
...@@ -391,7 +393,7 @@ class goodsManage extends Component { ...@@ -391,7 +393,7 @@ class goodsManage extends Component {
initCascader: null, initCascader: null,
}); });
this.props.form.resetFields(); this.props.form.resetFields();
this.BatchSetting.props.form.resetFields(); console.log(this.BatchSetting);
return; return;
} }
this.onCancel(); this.onCancel();
...@@ -417,7 +419,7 @@ class goodsManage extends Component { ...@@ -417,7 +419,7 @@ class goodsManage extends Component {
productType: 1, productType: 1,
}, },
() => { () => {
this.BatchSetting.props.form.resetFields(); this.BatchSetting.formRef.current.resetFields();
this.props.form.resetFields(); this.props.form.resetFields();
this.props.onCancel(); this.props.onCancel();
}, },
...@@ -437,7 +439,7 @@ class goodsManage extends Component { ...@@ -437,7 +439,7 @@ class goodsManage extends Component {
productType: event.target.value, productType: event.target.value,
}); });
this.props.form.resetFields(); this.props.form.resetFields();
this.BatchSetting.props.form.resetFields(); this.BatchSetting.formRef.current.resetFields();
}; };
validateToInputName = (rule, value, callback) => { validateToInputName = (rule, value, callback) => {
...@@ -561,7 +563,7 @@ class goodsManage extends Component { ...@@ -561,7 +563,7 @@ class goodsManage extends Component {
}, },
], ],
})( })(
<SuperSelect <Select
allowClear allowClear
showSearch showSearch
style={{ width: 280 }} style={{ width: 280 }}
...@@ -574,7 +576,7 @@ class goodsManage extends Component { ...@@ -574,7 +576,7 @@ class goodsManage extends Component {
{item.name} {item.name}
</Option> </Option>
))} ))}
</SuperSelect>, </Select>,
)} )}
</FormItem> </FormItem>
</Col> </Col>
...@@ -637,7 +639,7 @@ class goodsManage extends Component { ...@@ -637,7 +639,7 @@ class goodsManage extends Component {
> >
{this.state.specList.length && {this.state.specList.length &&
this.state.specList.map(item => ( this.state.specList.map(item => (
<Option key={item.specId} value={item.specId}> <Option value={item.specId} key={item.specId}>
{item.specName} {item.specName}
</Option> </Option>
))} ))}
...@@ -678,8 +680,9 @@ class goodsManage extends Component { ...@@ -678,8 +680,9 @@ class goodsManage extends Component {
/>, />,
)} )}
{firstKeys.length > 0 ? ( {firstKeys.length > 0 ? (
<MinusCircleOutlined <Icon
className="dynamic-delete-button" className="dynamic-delete-button"
type="minus-circle-o"
onClick={() => this.remove('firstKeys', k)} onClick={() => this.remove('firstKeys', k)}
/> />
) : null} ) : null}
...@@ -692,7 +695,7 @@ class goodsManage extends Component { ...@@ -692,7 +695,7 @@ class goodsManage extends Component {
onClick={() => this.add('firstKeys')} onClick={() => this.add('firstKeys')}
style={{ textAlign: 'center' }} style={{ textAlign: 'center' }}
> >
<PlusOutlined /> <Icon type="plus" />
</Button> </Button>
</FormItem> </FormItem>
</Row> </Row>
...@@ -741,8 +744,9 @@ class goodsManage extends Component { ...@@ -741,8 +744,9 @@ class goodsManage extends Component {
validateTrigger: ['onChange', 'onBlur'], validateTrigger: ['onChange', 'onBlur'],
})(<Input key={k} style={{ width: '60%', marginRight: 8 }} />)} })(<Input key={k} style={{ width: '60%', marginRight: 8 }} />)}
{secondKeys.length > 0 ? ( {secondKeys.length > 0 ? (
<MinusCircleOutlined <Icon
className="dynamic-delete-button" className="dynamic-delete-button"
type="minus-circle-o"
onClick={() => this.remove('secondKeys', k)} onClick={() => this.remove('secondKeys', k)}
/> />
) : null} ) : null}
...@@ -755,7 +759,7 @@ class goodsManage extends Component { ...@@ -755,7 +759,7 @@ class goodsManage extends Component {
style={{ textAlign: 'center' }} style={{ textAlign: 'center' }}
disabled={isJDGoods} disabled={isJDGoods}
> >
<PlusOutlined /> <Icon type="plus" />
</Button> </Button>
</FormItem> </FormItem>
</Row> </Row>
...@@ -786,7 +790,7 @@ class goodsManage extends Component { ...@@ -786,7 +790,7 @@ class goodsManage extends Component {
<Row> <Row>
<Table <Table
bordered bordered
rowKey="id" rowKey={r => r.thirdSkuNo}
pagination={false} pagination={false}
scroll={{ y: 300, x: 1200 }} scroll={{ y: 300, x: 1200 }}
dataSource={this.state.editData} dataSource={this.state.editData}
...@@ -811,7 +815,7 @@ class goodsManage extends Component { ...@@ -811,7 +815,7 @@ class goodsManage extends Component {
size="small" size="small"
onClick={this.deleteImg} onClick={this.deleteImg}
style={{ marginTop: '10px' }} style={{ marginTop: '10px' }}
icon={<RestOutlined />} icon="rest"
> >
图片批量删除 图片批量删除
</Button> </Button>
......
...@@ -329,7 +329,6 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods ...@@ -329,7 +329,6 @@ export function editColumns(methods, firstData, firstSpec, secondSpec, isJDGoods
]; ];
if (productType === 1) { if (productType === 1) {
// 如果是实体商品添加重量 // 如果是实体商品添加重量
console.log(arr);
arr.splice(2, 0, { arr.splice(2, 0, {
title: '重量(kg)', title: '重量(kg)',
align: 'center', align: 'center',
......
...@@ -103,7 +103,7 @@ export default () => { ...@@ -103,7 +103,7 @@ export default () => {
key="passaudit" key="passaudit"
columns={columns} columns={columns}
request={params => query(params, 2)} request={params => query(params, 2)}
rowKey="skuId" rowKey={r => r.orderId}
pagination={{ pagination={{
pagesSize: 20, pagesSize: 20,
}} }}
......
...@@ -23,7 +23,13 @@ export default props => { ...@@ -23,7 +23,13 @@ export default props => {
]; ];
return ( return (
<Modal title="订单详情" visible={visible} onCancel={handleCancel} footer={null} width={800}> <Modal title="订单详情" visible={visible} onCancel={handleCancel} footer={null} width={800}>
<Table dataSource={dataSource} columns={columns} key="skuName" pagination={false} bordered /> <Table
dataSource={dataSource}
columns={columns}
key={r => r.orderId}
pagination={false}
bordered
/>
</Modal> </Modal>
); );
}; };
...@@ -63,7 +63,9 @@ const TableList = () => { ...@@ -63,7 +63,9 @@ const TableList = () => {
renderFormItem: () => ( renderFormItem: () => (
<Select onChange={changeSupplier} value={shopId} allowClear> <Select onChange={changeSupplier} value={shopId} allowClear>
{supplierList.map(item => ( {supplierList.map(item => (
<Option value={item.id}>{item.name}</Option> <Option value={item.id} key={item.id}>
{item.name}
</Option>
))} ))}
</Select> </Select>
), ),
...@@ -149,7 +151,7 @@ const TableList = () => { ...@@ -149,7 +151,7 @@ const TableList = () => {
columns={columns} columns={columns}
params={{ shopId }} params={{ shopId }}
request={res => query(res)} request={res => query(res)}
rowKey="id" rowKey={r => r.batchNo}
bordered bordered
scroll={{ x: 1500 }} scroll={{ x: 1500 }}
search={{ search={{
......
...@@ -150,8 +150,9 @@ export default () => { ...@@ -150,8 +150,9 @@ export default () => {
}, },
{ {
title: '操作', title: '操作',
valueType: 'option', dataIndex: 'action',
width: 280, hideInSearch: true,
width: 200,
fixed: 'right', fixed: 'right',
render: (_, r) => tableRenderBtn(r), render: (_, r) => tableRenderBtn(r),
}, },
...@@ -165,7 +166,7 @@ export default () => { ...@@ -165,7 +166,7 @@ export default () => {
className={style.table} className={style.table}
request={query} request={query}
search={{ collapsed: false }} search={{ collapsed: false }}
rowKey="id" rowKey={r => r.settlementNo}
pagination={{ pagination={{
defaultCurrent: 1, defaultCurrent: 1,
}} }}
......
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