Commit 5dd50b67 authored by luoxiaodong's avatar luoxiaodong

升级版本

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