Commit 5f31f16c authored by beisir's avatar beisir

feat: 商品库列表库存不可修改&批量上传不可修改

parent e90c9293
...@@ -3,7 +3,7 @@ import React, { Component } from 'react'; ...@@ -3,7 +3,7 @@ import React, { Component } from 'react';
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 { uploadFile } from '../service'; // import { uploadFile } from '../service';
const FormItem = Form.Item; const FormItem = Form.Item;
const { Option } = Select; const { Option } = Select;
...@@ -43,31 +43,31 @@ class goodsManage extends Component { ...@@ -43,31 +43,31 @@ class goodsManage extends Component {
const iptNumWidth = { width: 118 }; const iptNumWidth = { width: 118 };
const that = this; const that = this;
const uploadProps = { // const uploadProps = {
name: 'file', // name: 'file',
async customRequest(info) { // async customRequest(info) {
const result = await uploadFile(info.file); // const result = await uploadFile(info.file);
if (result && result.businessCode === '0000') { // if (result && result.businessCode === '0000') {
that.handleSearch(); // that.handleSearch();
notification.success({ // notification.success({
message: '操作成功', // message: '操作成功',
}); // });
} else { // } else {
notification.warning({ // notification.warning({
message: result.msg, // message: result.msg,
description: ( // description: (
<div> // <div>
{result.data?.length && // {result.data?.length &&
result.data.map(item => <p>{item.skuNo + item.errSkuMessage}</p>)} // result.data.map(item => <p>{item.skuNo + item.errSkuMessage}</p>)}
</div> // </div>
), // ),
duration: 6, // duration: 6,
}); // });
} // }
}, // },
accept: '.xlsx', // accept: '.xlsx',
showUploadList: false, // showUploadList: false,
}; // };
const filterOption = (input, op) => op.props.children.includes(input); const filterOption = (input, op) => op.props.children.includes(input);
return ( return (
...@@ -144,7 +144,7 @@ class goodsManage extends Component { ...@@ -144,7 +144,7 @@ class goodsManage extends Component {
<Button type="primary" className={styles.button} onClick={this.addSpu}> <Button type="primary" className={styles.button} onClick={this.addSpu}>
新增商品 新增商品
</Button> </Button>
<Button {/* <Button
className={styles.button} className={styles.button}
type="primary" type="primary"
icon="download" icon="download"
...@@ -159,7 +159,7 @@ class goodsManage extends Component { ...@@ -159,7 +159,7 @@ class goodsManage extends Component {
<Button type="primary" className={styles.button}> <Button type="primary" className={styles.button}>
批量库存修改 批量库存修改
</Button> </Button>
</Upload> </Upload> */}
</FormItem> </FormItem>
</Form> </Form>
); );
......
...@@ -106,12 +106,13 @@ export function column() { ...@@ -106,12 +106,13 @@ export function column() {
align: 'center', align: 'center',
sorter: (a, b) => a.stock - b.stock, sorter: (a, b) => a.stock - b.stock,
render: (_, row) => { render: (_, row) => {
const stockView = // const stockView =
row.state !== 4 ? ( // row.state !== 4 ? (
<a onClick={() => this.openModal(row, 'productStock')}>{row.productStock}</a> // <a onClick={() => this.openModal(row, 'productStock')}>{row.productStock}</a>
) : ( // ) : (
<span>{row.productStock}</span> // <span>{row.productStock}</span>
); // );
const stockView = row.productStock;
return ( return (
<> <>
<p>当前库存:{stockView}</p> <p>当前库存:{stockView}</p>
......
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