Commit 429b4681 authored by guang.wu's avatar guang.wu

fix: 修改竞价列表展示字段

parent 310ca730
import { import { Form, Button, Input, Select, notification, Cascader, InputNumber } from 'antd';
Form,
Button,
Input,
Select,
notification,
Cascader,
InputNumber,
Popover,
Tag,
} from 'antd';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SwapRightOutlined } from '@ant-design/icons'; import { SwapRightOutlined } from '@ant-design/icons';
import { connect } from 'dva'; import { connect } from 'dva';
import styles from '../../style.less'; import styles from '../../style.less';
import { stateList } from '../../staticdata'; import { stateList } from '../../staticdata';
import { GOOD_MANAGE } from '@/../config/permission.config';
const FormItem = Form.Item; const FormItem = Form.Item;
const { Option } = Select; const { Option } = Select;
...@@ -97,33 +86,9 @@ class goodsManage extends Component { ...@@ -97,33 +86,9 @@ class goodsManage extends Component {
}; };
render() { render() {
const { treeData, permissions } = this.props; const { treeData } = this.props;
const selectW = { width: 250 }; const selectW = { width: 250 };
const iptNumWidth = { width: 118 }; const iptNumWidth = { width: 118 };
const canEditable = permissions[GOOD_MANAGE.EDITABLE];
const content = (
<div>
<Button style={{ border: 'none' }} onClick={() => this.setArea(1, 'distribution')}>
全部商品配送区域设置
</Button>
<br />
<Button style={{ border: 'none' }} onClick={() => this.setArea(0, 'distribution')}>
勾选商品配送区域设置
</Button>
<br />
<Button style={{ border: 'none' }} onClick={() => this.setArea(1, 'after')}>
全部商品售后地址设置
</Button>
<br />
<Button style={{ border: 'none' }} onClick={() => this.setArea(0, 'after')}>
勾选商品售后地址设置
</Button>
<br />
<Button style={{ border: 'none' }} onClick={() => this.checkEnableUpdateStock()}>
勾选商品库存修改
</Button>
</div>
);
const filterOption = (input, op) => op.props.children.includes(input); const filterOption = (input, op) => op.props.children.includes(input);
return ( return (
...@@ -202,24 +167,6 @@ class goodsManage extends Component { ...@@ -202,24 +167,6 @@ class goodsManage extends Component {
<Button onClick={() => this.onReset()} className={styles.button}> <Button onClick={() => this.onReset()} className={styles.button}>
重置 重置
</Button> </Button>
{this.state.productType !== 5 && (
<>
{canEditable ? (
<FormItem style={{ float: 'right' }}>
<Popover content={content} onVisibleChange={this.handleVisibleChange}>
<Button type="primary" className={styles.button}>
批量设置
</Button>
</Popover>
{this.props.selectNum > 0 && (
<Tag color="green">已选商品 {this.props.selectNum}</Tag>
)}
</FormItem>
) : (
''
)}
</>
)}
</FormItem> </FormItem>
</Form> </Form>
); );
......
...@@ -19,7 +19,8 @@ import { ...@@ -19,7 +19,8 @@ import {
apiProductBiddingInfo, apiProductBiddingInfo,
} from '../service'; } from '../service';
import LogModal from '../LogModal'; import LogModal from '../LogModal';
import { column, JDSHOPID } from '../staticdata'; import { JDSHOPID } from '../staticdata';
import { columnManage } from './staticdata';
import SearchForm from './components/SearchForm'; import SearchForm from './components/SearchForm';
import TempleatModal from '../TempleatModal'; import TempleatModal from '../TempleatModal';
import ServiceGoods from '../../ServiceGoods'; import ServiceGoods from '../../ServiceGoods';
...@@ -425,7 +426,7 @@ class supplyPriceUpdate extends Component { ...@@ -425,7 +426,7 @@ class supplyPriceUpdate extends Component {
<Table <Table
dataSource={tableData?.records} dataSource={tableData?.records}
bordered bordered
columns={column.call(this)} columns={columnManage.call(this)}
rowKey={record => record.skuId} rowKey={record => record.skuId}
pagination={false} pagination={false}
className={styles.tabletop} className={styles.tabletop}
......
import React from 'react'; import React from 'react';
import { Input, Form, InputNumber } from 'antd'; import { Input, Form, InputNumber, Button } from 'antd';
import { isIntegerNotMust, isCheckPriceTwoDecimal } from '@/utils/validator'; import { isIntegerNotMust, isCheckPriceTwoDecimal } from '@/utils/validator';
import styles from './style.less'; import styles from './style.less';
...@@ -17,7 +17,7 @@ export function column(specArr = []) { ...@@ -17,7 +17,7 @@ export function column(specArr = []) {
label="" label=""
key="supplyPrice" key="supplyPrice"
name={['data', index, 'supplyPrice']} name={['data', index, 'supplyPrice']}
initialValue={row.supplyPrice} initialValue={row.supplyPrice || 0}
rules={[ rules={[
{ required: true, message: '请输入供货价!' }, { required: true, message: '请输入供货价!' },
{ validator: isCheckPriceTwoDecimal }, { validator: isCheckPriceTwoDecimal },
...@@ -61,10 +61,10 @@ export function column(specArr = []) { ...@@ -61,10 +61,10 @@ export function column(specArr = []) {
label="" label=""
key="stock" key="stock"
name={['data', index, 'stock']} name={['data', index, 'stock']}
initialValue={row.productStock} initialValue={row.productStock || 0}
rules={[{ required: true, message: '请输入库存!' }, { validator: isIntegerNotMust }]} rules={[{ required: true, message: '请输入库存!' }, { validator: isIntegerNotMust }]}
> >
<InputNumber min={1} max={500} /> <InputNumber min={0} max={500} />
</Form.Item> </Form.Item>
</div> </div>
), ),
...@@ -83,3 +83,63 @@ export function column(specArr = []) { ...@@ -83,3 +83,63 @@ export function column(specArr = []) {
}, },
]; ];
} }
export function columnManage() {
return [
{
title: 'SKU编码',
dataIndex: 'skuId',
width: 160,
align: 'center',
},
{
title: 'SKU商品名称',
align: 'center',
dataIndex: 'skuName',
},
{
title: '供应商价格',
dataIndex: 'marketPrice',
width: 160,
align: 'center',
sorter: (a, b) => a.supplyPrice - b.supplyPrice,
render: (_, row) => (
<div className={styles.price}>
<p>市场价:{(row.marketPrice || 0).toFixed(2)}</p>
</div>
),
},
{
title: '操作',
dataIndex: 'action',
width: 150,
align: 'center',
render: (_, row) => (
<div className={styles.actionBtn}>
{this.canEditable && (row.state === 4 || (row.state >= 5 && row.updateState !== 1)) && (
<Button
key="edit"
type="primary"
size="small"
className={styles.button}
onClick={() => {
this.serviceVisbleChange(row);
}}
>
修改
</Button>
)}
<Button
key="viewP"
type="primary"
size="small"
className={styles.button}
onClick={() => this.audit(row.skuId)}
>
预览
</Button>
</div>
),
},
];
}
...@@ -12,3 +12,6 @@ ...@@ -12,3 +12,6 @@
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
} }
.button {
margin: 0 5px;
}
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