Commit ccc481a4 authored by beisir's avatar beisir

feat: 商户管理联调接口

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