Commit ccc481a4 authored by beisir's avatar beisir

feat: 商户管理联调接口

parent ae649573
......@@ -3,6 +3,7 @@ const isProduction = process.env.NODE_ENV === 'production';
let envAPi = {
api: '//backstms-gyl2.liangkebang.net',
kdspOpApi: 'https://kdsp-operation-gyl2.liangkebang.net',
// kdspApi: 'http://192.168.28.107:7000',
kdspApi: 'https://sc-op-api-gyl2.liangkebang.net',
prologueDomain: 'https://prologue-gyl2.liangkebang.net',
qiniuHost: 'https://appsync.lkbang.net',
......
......@@ -122,9 +122,6 @@ class goodsManage extends Component {
/>,
)}
</FormItem>
<FormItem label="第三方SKU编码">
{getFieldDecorator('thirdSkuNo', {})(<Input allowClear style={selectW} />)}
</FormItem>
<FormItem label="审核状态">
{getFieldDecorator('state', {})(
<Select style={selectW} allowClear showSearch filterOption={filterOption}>
......@@ -147,6 +144,9 @@ class goodsManage extends Component {
)}
</FormItem>
</FormItem>
<FormItem label="第三方SKU编码">
{getFieldDecorator('thirdSkuNo', {})(<Input allowClear style={selectW} />)}
</FormItem>
<FormItem className={styles.queryBtn}>
<Button onClick={() => this.handleSearch()} type="primary" className={styles.button}>
查询
......
......@@ -354,7 +354,7 @@ class goodsManage extends Component {
name: values.name,
items: prev.editData,
brandId: values.brandId,
supplierId: values.supplierId,
supplierId: null,
detailImageList: values.detailImageList,
commonImageList: values.commonImageList || [],
categoryId: prev.categoryId ? prev.categoryId : initData?.thirdCategoryId,
......
......@@ -61,7 +61,6 @@ class goodsManage extends Component {
componentDidMount() {
this.props.goodsManage.tableData = {};
this.getShopList();
this.categoryList();
this.getVirtualCategory();
}
......@@ -222,12 +221,6 @@ class goodsManage extends Component {
this.setState({ offlineVisible: true, selectedParams: obj });
};
// 获取供应商列表
getShopList = async () => {
const { data } = await getSupplierList();
this.shopList = data || [];
};
filterShopList = (list = [], isEdit) =>
list.filter(item => isEdit || !JDSHOPID.includes(item.id));
......@@ -289,13 +282,13 @@ class goodsManage extends Component {
goodsManage: { tableData = {} },
} = this.props;
const { pageNo, pageSize, selectedRowKeys } = this.state;
const rowSelection = {
selectedRowKeys,
onChange: this.onSelectChange,
getCheckboxProps: record => ({
disabled: +record.state === 6, // Column configuration not to be checked
}),
};
// const rowSelection = {
// selectedRowKeys,
// onChange: this.onSelectChange,
// getCheckboxProps: record => ({
// disabled: +record.state === 6, // Column configuration not to be checked
// }),
// };
return (
<PageHeaderWrapper>
<Spin spinning={this.state.createloading}>
......@@ -304,7 +297,7 @@ class goodsManage extends Component {
handleSearch={this.handleSearch}
onReset={this.onReset}
onLoad={this.onLoad}
selectedRowKeys={this.state.selectedRowKeys}
// selectedRowKeys={this.state.selectedRowKeys}
onRef={ref => {
this.searchForm = ref;
}}
......@@ -321,13 +314,14 @@ class goodsManage extends Component {
rowKey={record => record.skuId}
pagination={false}
className={styles.tabletop}
rowSelection={rowSelection}
// rowSelection={rowSelection}
scroll={{ x: '100%', y: 500 }}
/>
</Spin>
<br />
{tableData && (
<Pagination
style={{ marginBottom: 10 }}
onChange={this.onPageChange}
total={tableData.total}
showTotal={total => `共${total}条`}
......
......@@ -12,16 +12,17 @@ const headers = {
};
export async function searchList(params) {
return request.post('/product/page', {
return request.post('/product/api/merchant/page', {
prefix: kdspApi,
data: stringify(_.omitBy(params, v => !v)),
headers,
role: true,
});
}
// 新增商品
export async function addGoods(params) {
return request.post('/product/add', {
return request.post('/product/api/merchant/add', {
prefix: kdspApi,
data: params,
});
......@@ -30,7 +31,7 @@ export async function addGoods(params) {
// 编辑商品
export async function editGoods(params) {
return request.post('/product/edit', {
return request.post('/product/api/merchant/edit', {
prefix: kdspApi,
data: params,
});
......@@ -44,14 +45,14 @@ export async function getSupplierList() {
}
// 获取商品品牌
export async function getBrandList() {
return request.post('/product/brand/list', {
return request.post('/product/brand/api/merchant/list', {
prefix: kdspApi,
});
}
// 编辑--获取详情
export async function spuDetail(params) {
return request.post('/product/detail', {
return request.post('/product/api/merchant/detail', {
prefix: kdspApi,
params,
headers,
......@@ -60,14 +61,14 @@ export async function spuDetail(params) {
// 商品规格
export async function getSpecList() {
return request.post('/product/spec/list', {
return request.post('/product/spec/api/merchant/list', {
prefix: kdspApi,
});
}
// 查询图片素材
export async function getImageInfo(spuNo) {
return request.post('/product/imageInfo', {
return request.post('/product/api/merchant/imageInfo', {
params: { spuNo },
prefix: kdspApi,
headers,
......@@ -84,9 +85,8 @@ export async function skuSource() {
}
// 商品分类
export async function categoryList() {
return request.post('/product/category/getAll', {
return request.post('/product/category/api/merchant/getAll', {
prefix: kdspApi,
headers,
});
}
......@@ -94,10 +94,10 @@ export async function categoryList() {
export async function uploadFile(file) {
const params = new FormData();
params.append('file', file);
const data = await request.post('/product/item/batchUpdate', {
// const data = await request.post('/product/item/batchUpdate', {
const data = await request.post('/product/api/merchant/BatchUpdateStock', {
prefix: kdspApi,
data: params,
rawData: true,
});
return data;
}
......@@ -143,7 +143,7 @@ export async function update(params) {
// 商品修改日志
export async function changeLog(params) {
return request.post('/product/logs/page', {
return request.post('/product/logs/api/merchant/page', {
data: stringify(_.omitBy(params, v => !v)),
prefix: kdspApi,
headers,
......@@ -161,7 +161,7 @@ export async function detail(params) {
// 拉去京东图片
export async function getJdPicList(params) {
const { data } = await request.post('/product/item/getJdPicList', {
const { data } = await request.post('/product/api/merchant/item/getJdPicList', {
data: stringify(_.omitBy(params, v => !v)),
prefix: kdspApi,
headers,
......@@ -185,7 +185,7 @@ export async function updateSku(params) {
export async function uploadImg(files) {
const params = new FormData();
files.forEach(file => params.append('file', file));
const data = await request.post('/image/upload', {
const data = await request.post('/image/api/merchant/upload', {
prefix: kdspApi,
data: params,
});
......@@ -205,7 +205,7 @@ export async function updatePrice(params) {
}
// 修改商品库存
export async function updateStock(params) {
const data = await request.post('/product/item/updateStock', {
const data = await request.post('/product/item/api/merchant/updateStock', {
prefix: kdspApi,
data: stringify(_.omitBy(params, v => !v)),
headers,
......@@ -218,7 +218,7 @@ export async function updateStock(params) {
// 获取虚拟商品类目
export async function getVirtualCategory() {
const data = await request.post('/product/category/getByParentId', {
const data = await request.post('/product/category/api/merchant/getByParentId', {
prefix: kdspApi,
data: stringify(_.omitBy({ id: 100018 }, v => !v)),
headers,
......
......@@ -122,6 +122,7 @@ export function column() {
dataIndex: 'stateDesc',
width: 200,
align: 'center',
render: (_, row) => <span>{row.state >= 5 ? '审核通过' : _}</span>,
},
{
title: '操作',
......@@ -130,15 +131,17 @@ export function column() {
align: 'center',
render: (_, row) => (
<div className={styles.actionBtn}>
<Button
key="edit"
type="primary"
size="small"
className={styles.button}
onClick={() => this.onUpdateInfo(row)}
>
编辑
</Button>
{row.state === 4 && (
<Button
key="edit"
type="primary"
size="small"
className={styles.button}
onClick={() => this.onUpdateInfo(row)}
>
编辑
</Button>
)}
<Button
key="viewP"
type="primary"
......@@ -166,7 +169,7 @@ export const disSelectStatus = [2, 5];
export const stateList = [
{ value: 3, label: '待审核' },
{ value: 4, label: '申请驳回' },
{ value: 5, label: '未上架' },
{ value: 5, label: '审核通过' },
];
// AUDITING(3, "待审核"),REJECTED(4, "申请驳回"),WAIT_SELL(5, "未上架"),ON_SELL(6, "已上架"),OFF_SHELVES(7, "已下架"))
......
......@@ -102,6 +102,12 @@ request.interceptors.response.use(async (response, options) => {
}
const data = await response.clone().json();
if (data.code === 4033) {
// TODO 该接口是否需要提示权限信息
if (options.role) {
notification.warning({
message: '没有权限访问!',
});
}
// token过期
const url = response.url.split(config.api)[1];
return refreshRequest(url, options);
......
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