Commit 2ca85f31 authored by beisir's avatar beisir

fix: 修改验收意见

parent 7b9919f4
const isProduction = process.env.NODE_ENV === 'production';
let envAPi = {
api: '//backstms-gyl2.liangkebang.net',
kdspOpApi: 'https://kdsp-operation-gyl2.liangkebang.net',
api: '//backstms-test1.liangkebang.net',
kdspOpApi: 'https://kdsp-operation-test1.liangkebang.net',
// kdspApi: 'http://192.168.28.107:7000',
kdspApi: 'https://sc-op-api-gyl2.liangkebang.net',
prologueDomain: 'https://prologue-gyl2.liangkebang.net',
kdspApi: 'https://sc-op-api-test1.liangkebang.net',
prologueDomain: 'https://prologue-test1.liangkebang.net',
qiniuHost: 'https://appsync.lkbang.net',
opapiHost: 'https://opapi-gyl2.liangkebang.net',
opapiHost: 'https://opapi-test1.liangkebang.net',
// opapiHost: 'http://192.168.29.45:7000',
};
......
import { Modal, Table, Button, Pagination } from 'antd';
import { Modal, Table, Button, Pagination, Tabs } from 'antd';
import React, { useState, useEffect } from 'react';
import styles from '../style.less';
import { changeLog } from '../service';
import { changeLog, productMerchantLog } from '../service';
const LogModal = props => {
const [tabActiveKey, setTabActiveKey] = useState('0');
const [tableData, setTableData] = useState([]);
const [pageNo, setPageNo] = useState(1);
const [pageSize] = useState(20);
const [merchantList, setMerchantList] = useState([]);
const columns = [
{
title: '时间',
......@@ -39,40 +41,100 @@ const LogModal = props => {
align: 'center',
},
];
const columnsMerchant = [
{
title: '时间',
dataIndex: 'createdAt',
align: 'center',
},
{
title: '审核结果',
align: 'center',
dataIndex: 'operation',
render: value => ([5, 6, 7].includes(value) ? '审核通过' : '驳回'),
},
{
title: '驳回原因',
dataIndex: 'rejectReason',
align: 'center',
},
{
title: '操作账号',
dataIndex: 'createdBy',
align: 'center',
},
];
const handleSearch = async (page = 1) => {
setPageNo(page);
const { data = {} } = await changeLog({ id: props.id, pageNo: page, pageSize });
setTableData(data);
};
const onPageChange = page => {
handleSearch(page);
};
const getProductMerchantLog = async () => {
const { data = [] } = await productMerchantLog(props.spuId);
setMerchantList(data); // merchantList
};
const bundleOnTabChange = key => {
if (key === '1') {
getProductMerchantLog();
} else {
onPageChange(1);
}
setTabActiveKey(key);
};
const bundleOnCancel = () => {
setMerchantList([]);
setTabActiveKey('0');
props.onCancel();
};
useEffect(() => {
if (!props.id) return;
handleSearch();
}, [props.id]);
const { visible } = props;
return (
<Modal title="日志详情" visible={visible} footer={null} onCancel={props.onCancel} width="800px">
<Table
dataSource={tableData.records}
bordered
columns={columns}
rowKey={record => record.id}
pagination={false}
scroll={{ y: 300 }}
/>
{tableData.records && (
<Pagination
onChange={onPageChange}
total={tableData.total}
showTotal={total => `共${total}条`}
current={pageNo}
pageSize={pageSize}
className={styles.pagination}
/>
)}
<Button type="primary" onClick={props.onCancel} className={styles.logBtn}>
<Modal title="日志详情" visible={visible} footer={null} onCancel={bundleOnCancel} width="800px">
<Tabs type="card" onChange={bundleOnTabChange} activeKey={tabActiveKey}>
<Tabs.TabPane tab="订单详情" key="0">
<Table
dataSource={tableData.records}
bordered
columns={columns}
rowKey={record => record.id}
pagination={false}
scroll={{ y: 300 }}
/>
{tableData.records && (
<Pagination
onChange={onPageChange}
total={tableData.total}
showTotal={total => `共${total}条`}
current={pageNo}
pageSize={pageSize}
className={styles.pagination}
/>
)}
</Tabs.TabPane>
<Tabs.TabPane tab="审核详情" key="1">
<Table
dataSource={merchantList}
bordered
columns={columnsMerchant}
rowKey={record => record.id}
pagination={false}
scroll={{ y: 300 }}
/>
</Tabs.TabPane>
</Tabs>
<Button type="primary" onClick={bundleOnCancel} className={styles.logBtn}>
关闭
</Button>
</Modal>
......
......@@ -31,6 +31,7 @@ class goodsManage extends Component {
if (!isEdit) item.productStock = data.productStock; // 编辑状态不可修改库存
item.supplyPrice = data.supplyPrice;
item.weight = data.weight;
item.productStockWarning = data.productStockWarning;
});
}
if (data.firstSpecValue && !data.secondSpecValue) {
......@@ -41,6 +42,7 @@ class goodsManage extends Component {
if (!isEdit) item.productStock = data.productStock;
item.supplyPrice = data.supplyPrice;
item.weight = data.weight;
item.productStockWarning = data.productStockWarning;
}
});
}
......@@ -52,6 +54,7 @@ class goodsManage extends Component {
if (!isEdit) item.productStock = data.productStock;
item.supplyPrice = data.supplyPrice;
item.weight = data.weight;
item.productStockWarning = data.productStockWarning;
}
});
}
......@@ -66,6 +69,7 @@ class goodsManage extends Component {
if (!isEdit) item.productStock = data.productStock;
item.supplyPrice = data.supplyPrice;
item.weight = data.weight;
item.productStockWarning = data.productStockWarning;
}
});
}
......@@ -139,7 +143,7 @@ class goodsManage extends Component {
max={999999.999}
// eslint-disable-next-line radix
placeholder="重量"
style={{ width: 150 }}
style={{ width: 130 }}
/>,
)}
</FormItem>
......@@ -158,6 +162,17 @@ class goodsManage extends Component {
)}
</FormItem>
)}
<FormItem>
{getFieldDecorator('productStockWarning', {})(
<InputNumber
placeholder="库存预警"
maxLength={5}
min={0}
precision={0}
style={{ width: 100 }}
/>,
)}
</FormItem>
<FormItem>
<Button type="primary" htmlType="submit" onClick={this.batchSetting}>
批量设置
......
......@@ -513,7 +513,7 @@ class goodsManage extends Component {
fieldNames={{ label: 'name', value: 'id', children: 'children' }}
options={treeDataArray}
onChange={(val, label, ext) => this.treeChange(val, label, ext)}
disabled={isEdit}
// disabled={isEdit}
/>,
)}
</FormItem>
......@@ -586,7 +586,7 @@ class goodsManage extends Component {
allowClear
showSearch
style={{ width: 200 }}
disabled={isEdit}
disabled={isEdit && initData.firstSpecId}
onChange={(val, option) =>
this.specChange('first', option?.props.children, val)
}
......@@ -664,7 +664,7 @@ class goodsManage extends Component {
<Select
allowClear
showSearch
disabled={isEdit}
disabled={isEdit && initData.secondSpecId}
style={{ width: 200 }}
onChange={(val, option) => this.specChange('second', option?.props.children)}
filterOption={(input, option) =>
......
......@@ -53,7 +53,7 @@ class goodsManage extends Component {
loading = false;
currentSkuId = null;
currentLog = null;
supplierId = null;
......@@ -189,8 +189,8 @@ class goodsManage extends Component {
}
};
viewLog = async skuId => {
this.currentSkuId = skuId;
viewLog = async rows => {
this.currentLog = rows;
this.setState({
logVisible: true,
});
......@@ -341,9 +341,10 @@ class goodsManage extends Component {
<LogModal
visible={this.state.logVisible}
id={this.currentSkuId}
spuId={this.currentLog?.spuId}
id={this.currentLog?.skuId}
onCancel={() => {
this.currentSkuId = null;
this.currentLog = null;
this.setState({ logVisible: false });
}}
/>
......
......@@ -150,6 +150,15 @@ export async function changeLog(params) {
});
}
export async function productMerchantLog(productId) {
return request.get('/product/api/merchant/auditLog', {
params: {
productId,
},
prefix: kdspApi,
});
}
// 商品详情
export async function detail(params) {
return request.post('/product/supply/list', {
......
......@@ -94,7 +94,7 @@ export function column() {
sorter: (a, b) => a.supplyPrice - b.supplyPrice,
render: (_, row) => (
<div className={styles.price}>
<p>供货价:{row.supplyPrice.toFixed(2)}</p>
<p>供货价:{(row.supplyPrice || 0).toFixed(2)}</p>
<p>市场价:{(row.marketPrice || 0).toFixed(2)}</p>
</div>
),
......@@ -139,7 +139,7 @@ export function column() {
className={styles.button}
onClick={() => this.onUpdateInfo(row)}
>
编辑
修改
</Button>
)}
<Button
......@@ -156,7 +156,7 @@ export function column() {
size="small"
type="primary"
className={styles.button}
onClick={() => this.viewLog(row.skuId)}
onClick={() => this.viewLog(row)}
>
查看日志
</Button>
......@@ -168,11 +168,11 @@ export function column() {
export const disSelectStatus = [2, 5];
export const stateList = [
{ value: 3, label: '待审核' },
{ value: 4, label: '申请驳回' },
{ value: 4, 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, "已下架"))
export const productTypeList = [
{ value: 1, label: '实体商品' },
{ value: 2, label: '虚拟充值' },
......
......@@ -4,6 +4,9 @@ import { ReactSortable } from 'react-sortablejs';
import { uploadImg } from '../../GoodsManage/service';
import styles from './styles.less';
const ImageInfo = file => {
console.log(file);
};
class PicturesWall extends React.Component {
state = {
previewVisible: false,
......
......@@ -122,7 +122,7 @@ request.interceptors.response.use(async (response, options) => {
});
window.location.href = loginPath;
}
if (data.businessCode && data.businessCode !== '0000') {
if ((data.businessCode && data.businessCode !== '0000') || data.businessCode === null) {
notification.warning({
message: data.detail || data.msg || '操作失败',
});
......
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