Commit db562e8c authored by 武广's avatar 武广

fix: 修改类型

parent 3581b8d6
...@@ -31,6 +31,7 @@ class goodsManage extends Component { ...@@ -31,6 +31,7 @@ class goodsManage extends Component {
state = { state = {
loading: false, loading: false,
productType: null,
}; };
componentDidMount() { componentDidMount() {
...@@ -78,6 +79,13 @@ class goodsManage extends Component { ...@@ -78,6 +79,13 @@ class goodsManage extends Component {
} }
}; };
onChangeProductType = (v = null) => {
this.props.changeProductType(v);
this.setState({
productType: v,
});
};
// 导出明细 // 导出明细
onExportGoodsInfo = async () => { onExportGoodsInfo = async () => {
this.setState({ this.setState({
...@@ -105,7 +113,6 @@ class goodsManage extends Component { ...@@ -105,7 +113,6 @@ class goodsManage extends Component {
const { treeData, permissions } = this.props; const { treeData, permissions } = this.props;
const selectW = { width: 250 }; const selectW = { width: 250 };
const iptNumWidth = { width: 118 }; const iptNumWidth = { width: 118 };
const that = this;
const canEditable = permissions[GOOD_MANAGE.EDITABLE]; const canEditable = permissions[GOOD_MANAGE.EDITABLE];
const content = ( const content = (
<div> <div>
...@@ -130,31 +137,6 @@ class goodsManage extends Component { ...@@ -130,31 +137,6 @@ class goodsManage extends Component {
</Button> </Button>
</div> </div>
); );
// const uploadProps = {
// name: 'file',
// async customRequest(info) {
// const result = await uploadFile(info.file);
// if (result && result.businessCode === '0000') {
// that.handleSearch();
// notification.success({
// message: '操作成功',
// });
// } else {
// notification.warning({
// message: result.msg,
// description: (
// <div>
// {result.data?.length &&
// result.data.map(item => <p>{item.skuNo + item.errSkuMessage}</p>)}
// </div>
// ),
// duration: 6,
// });
// }
// },
// accept: '.xlsx',
// showUploadList: false,
// };
const filterOption = (input, op) => op.props.children.includes(input); const filterOption = (input, op) => op.props.children.includes(input);
return ( return (
...@@ -170,6 +152,19 @@ class goodsManage extends Component { ...@@ -170,6 +152,19 @@ class goodsManage extends Component {
<FormItem label="商品名称" name="skuName"> <FormItem label="商品名称" name="skuName">
<Input placeholder="请输入商品名称" allowClear style={selectW} /> <Input placeholder="请输入商品名称" allowClear style={selectW} />
</FormItem> </FormItem>
<FormItem label="商品类型" name="productType">
<Select
style={selectW}
placeholder="请选择商品类型"
allowClear
onChange={this.onChangeProductType}
>
<Option value={1}>实体商品</Option>
<Option value={2}>虚拟商品</Option>
<Option value={4}>服务类商品</Option>
<Option value={5}>外卖商品</Option>
</Select>
</FormItem>
<FormItem label="类目" name="productCategoryId"> <FormItem label="类目" name="productCategoryId">
<Cascader <Cascader
placeholder="请选择类目" placeholder="请选择类目"
...@@ -180,20 +175,22 @@ class goodsManage extends Component { ...@@ -180,20 +175,22 @@ class goodsManage extends Component {
options={treeData} options={treeData}
/> />
</FormItem> </FormItem>
<FormItem label="审核状态" name="state"> {this.state.productType !== 5 && (
<Select <FormItem label="审核状态" name="state">
style={selectW} <Select
placeholder="请选择审核状态" style={selectW}
allowClear placeholder="请选择审核状态"
filterOption={filterOption} allowClear
> filterOption={filterOption}
{stateList?.map(item => ( >
<Option key={item.value} value={item.value}> {stateList?.map(item => (
{item.label} <Option key={item.value} value={item.value}>
</Option> {item.label}
))} </Option>
</Select> ))}
</FormItem> </Select>
</FormItem>
)}
<FormItem label="供货价区间"> <FormItem label="供货价区间">
<FormItem name="supplyPriceMin" className={styles.iptNumRight} noStyle> <FormItem name="supplyPriceMin" className={styles.iptNumRight} noStyle>
<InputNumber placeholder="请输入" style={iptNumWidth} /> <InputNumber placeholder="请输入" style={iptNumWidth} />
...@@ -203,16 +200,11 @@ class goodsManage extends Component { ...@@ -203,16 +200,11 @@ class goodsManage extends Component {
<InputNumber style={iptNumWidth} placeholder="请输入" onChange={this.valueMin} /> <InputNumber style={iptNumWidth} placeholder="请输入" onChange={this.valueMin} />
</FormItem> </FormItem>
</FormItem> </FormItem>
<FormItem label="商品类型" name="productType"> {this.state.productType !== 5 && (
<Select style={selectW} placeholder="请选择商品类型"> <FormItem name="thirdSkuNo" label="第三方SKU编码">
<Option value={1}>实体商品</Option> <Input placeholder="请输入第三方SKU编码" allowClear style={selectW} />
<Option value={2}>虚拟商品</Option> </FormItem>
<Option value={4}>服务类商品</Option> )}
</Select>
</FormItem>
<FormItem name="thirdSkuNo" label="第三方SKU编码">
<Input placeholder="请输入第三方SKU编码" allowClear style={selectW} />
</FormItem>
<FormItem className={styles.queryBtn}> <FormItem className={styles.queryBtn}>
<Button onClick={() => this.handleSearch()} type="primary" className={styles.button}> <Button onClick={() => this.handleSearch()} type="primary" className={styles.button}>
查询 查询
...@@ -236,22 +228,6 @@ class goodsManage extends Component { ...@@ -236,22 +228,6 @@ class goodsManage extends Component {
</Button> </Button>
</Popover> </Popover>
{this.props.selectNum > 0 && <Tag color="green">已选商品 {this.props.selectNum}</Tag>} {this.props.selectNum > 0 && <Tag color="green">已选商品 {this.props.selectNum}</Tag>}
{/* <Button
className={styles.button}
type="primary"
icon="download"
ghost
onClick={() => {
window.location.href = 'https://kdspstatic.q-gp.com/批量修改库存模板.xlsx';
}}
>
模版
</Button>
<Upload {...uploadProps}>
<Button type="primary" className={styles.button}>
批量库存修改
</Button>
</Upload> */}
</FormItem> </FormItem>
) : ( ) : (
'' ''
......
...@@ -12,6 +12,7 @@ import UpdateStock from './UpdateStock'; ...@@ -12,6 +12,7 @@ import UpdateStock from './UpdateStock';
import { import {
spuDetail, spuDetail,
categoryList, categoryList,
apiCategoryListType,
getVirtualCategory, getVirtualCategory,
getTemplateList, getTemplateList,
specList, specList,
...@@ -265,9 +266,10 @@ class goodsManage extends Component { ...@@ -265,9 +266,10 @@ class goodsManage extends Component {
} }
}; };
categoryList = async () => { categoryList = async type => {
const api = type ? apiCategoryListType : categoryList;
try { try {
const { data: treeData } = await categoryList(); const { data: treeData } = await api(type);
if (!treeData) return; if (!treeData) return;
this.setState({ treeData }); this.setState({ treeData });
} catch (e) { } catch (e) {
...@@ -275,6 +277,10 @@ class goodsManage extends Component { ...@@ -275,6 +277,10 @@ class goodsManage extends Component {
} }
}; };
changeProductType = e => {
this.categoryList(e);
};
getVirtualCategory = async () => { getVirtualCategory = async () => {
try { try {
const { data: virtualTreeData } = await getVirtualCategory(); const { data: virtualTreeData } = await getVirtualCategory();
...@@ -404,6 +410,7 @@ class goodsManage extends Component { ...@@ -404,6 +410,7 @@ class goodsManage extends Component {
shopList={this.shopList} shopList={this.shopList}
checkStock={this.checkEnableUpdateStock} checkStock={this.checkEnableUpdateStock}
selectNum={selectedRowKeys.length} selectNum={selectedRowKeys.length}
changeProductType={this.changeProductType}
setArea={(isALL, type) => this.setArea(isALL, type)} setArea={(isALL, type) => this.setArea(isALL, type)}
/> />
</Card> </Card>
......
...@@ -89,7 +89,7 @@ export async function categoryList() { ...@@ -89,7 +89,7 @@ export async function categoryList() {
} }
/** /**
* 商品分类 * 商品分类
* type 商品类型:1-实物类,2-虚拟类,4-服务类 * type 商品类型:1-实物类,2-虚拟类,4-服务类 5 外卖
* */ * */
export async function apiCategoryListType(type) { export async function apiCategoryListType(type) {
return request.get(`/product/category/getByProductType/${type}`, { return request.get(`/product/category/getByProductType/${type}`, {
......
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