Commit a16f094d authored by 卢均锐's avatar 卢均锐

feat: 缓存操作日志-商品日志

parent 60ec26fe
import React from 'react';
import StatusTag from '@/components/StatusTag';
import { status_3, operation_3 } from './constants'
import { formatTimeString } from '@/utils/index';
const base_columns_outer = [
{
title: '操作角色',
dataIndex: 'operationRole',
key: 'operationRole'
dataIndex: 'memberRoleName',
key: 'memberRoleName'
},
{
title: '状态',
......@@ -18,13 +24,14 @@ const base_columns_outer = [
},
{
title: '操作时间',
dataIndex: 'operationTime',
key: 'operationTime'
dataIndex: 'createTime',
key: 'createTime',
render: (_, text) => formatTimeString(text, 'YYYY-MM-DD HH:mm')
},
{
title: '备注',
dataIndex: 'remarks',
key: 'remarks'
dataIndex: 'checkRemark',
key: 'checkRemark'
},
]
......@@ -70,8 +77,6 @@ const base_columns_inner = [
const columns_base_1 = [{ title: '订单号', dataIndex: 'orderNo', key: 'orderNo' }];
// 售后
const columns_base_2 = [{ title: '申请单号', dataIndex: 'applyNo', key: 'applyNo' }, { title: '售后类型', dataIndex: 'type', key: 'type' }];
// 商品
const columns_base_3 = [{ title: '商品ID', dataIndex: 'goodsId', key: 'goodsId' }];
// 会员
const columns_base_4 = [{ title: '会员ID', dataIndex: 'memberId', key: 'memberId' }, { title: '操作类型', dataIndex: 'operationType', key: 'operationType' }];
// 商品询价
......@@ -88,11 +93,78 @@ export const columns_outer_1 = columns_base_1.concat(base_columns_outer);
// 售后外部
export const columns_outer_2 = columns_base_2.concat(base_columns_outer);
// 商品外部
export const columns_outer_3 = columns_base_3.concat(base_columns_outer);
export const columns_outer_3 = [
{
title: '商品ID',
dataIndex: 'commodityId',
key: 'commodityId'
},
{
title: '操作角色',
dataIndex: 'memberRoleName',
key: 'memberRoleName'
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
render: (text) => <StatusTag title={status_3[text].text} type={status_3[text].type} />
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
render: (text) => operation_3[text]
},
{
title: '操作时间',
dataIndex: 'createTime',
key: 'createTime',
render: (text) => formatTimeString(text, 'YYYY-MM-DD HH:mm')
},
{
title: '备注',
dataIndex: 'checkRemark',
key: 'checkRemark'
},
];
// 会员外部
export const columns_outer_4 = columns_base_4.concat(base_columns_outer);
// 商品询价外部
export const columns_outer_5 = columns_base_5.concat(base_columns_outer);
export const columns_outer_5 = [
{
title: '询价单号',
dataIndex: 'inquiryListId',
key: 'inquiryListId'
},
{
title: '操作角色',
dataIndex: 'roleName',
key: 'roleName'
},
{
title: '状态',
dataIndex: 'state',
key: 'state',
render: (text,record) => <StatusTag title={record.stateName} type={'default'} />
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
},
{
title: '操作时间',
dataIndex: 'operationTime',
key: 'operationTime',
render: (text) => formatTimeString(text, 'YYYY-MM-DD HH:mm')
},
{
title: '备注',
dataIndex: 'auditOpinion',
key: 'auditOpinion'
},
];
// 采购外部
export const columns_outer_6 = columns_base_6.concat(base_columns_outer);
// 合同外部
......@@ -106,7 +178,48 @@ export const columns_inner_1 = columns_base_1.concat(base_columns_inner);
// 售后内部
export const columns_inner_2 = columns_base_2.concat(base_columns_inner);
// 商品内部
export const columns_inner_3 = columns_base_3.concat(base_columns_inner);
export const columns_inner_3 = [
{
title: '商品ID',
dataIndex: 'commodityId',
key: 'commodityId'
},
{
title: '操作角色',
dataIndex: 'memberRoleName',
key: 'memberRoleName'
},
{
title: '部门',
dataIndex: 'operatorOrgName',
key: 'operatorOrgName'
},
{
title: '职位',
dataIndex: 'operatorJobTitle',
key: 'operatorJobTitle'
},
{
title: '状态',
dataIndex: 'status',
key: 'status'
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation'
},
{
title: '操作时间',
dataIndex: 'operationTime',
key: 'operationTime'
},
{
title: '备注',
dataIndex: 'remarks',
key: 'remarks'
},
];
// 会员内部
export const columns_inner_4 = columns_base_4.concat(base_columns_inner);
// 商品询价内部
......
export const status_3 = {
1: {text: '待提交审核',type: 'warnning'},
2: {text: '待审核',type: 'warnning'},
3: {text: '审核不通过',type: 'danger'},
4: {text: '审核通过',type: 'success'},
};
export const operation_3 = {
1: '新增',
2: '修改',
3: '审核',
}
......@@ -4,6 +4,8 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Radio } from 'antd';
import { StandardTable } from 'god';
import { getProductCommodityGetCommodityCheckRecordList } from '@/services/ProductV2Api'
import Search from '@/components/NiceForm/components/Search';
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix';
import Submit from '@/components/NiceForm/components/Submit';
......@@ -75,9 +77,9 @@ const OperationLog: React.FC = () => {
switch (typeState) {
case 1: _type = 'orderNo'; break;
case 2: _type = 'applyNo'; break;
case 3: _type = 'goodsId'; break;
case 3: _type = 'commodityId'; break;
case 4: _type = 'memberId'; break;
case 5: _type = 'inquiryListNo'; break;
case 5: _type = 'inquiryListId'; break;
case 6: _type = 'no'; break;
case 7: _type = 'contractNo'; break;
case 8: _type = 'id'; break;
......@@ -116,8 +118,34 @@ const OperationLog: React.FC = () => {
}, [typeState])
const _tableKey = useMemo(() => {
return `table_${_actionKey}`
}, [_actionKey])
return `table_${_actionKey}_${extraState}_${statusState}`
}, [_actionKey, extraState, statusState])
const fetchTableData = async (params: any) => {
let _fetch: any;
switch (typeState) {
case 1: break;
case 2: break;
case 3:
if (statusState === 1) {
_fetch = getProductCommodityGetCommodityCheckRecordList;
}
break;
case 4: break;
case 5: break;
case 6: break;
case 7: break;
case 8: break;
default:
break;
}
if (_fetch) {
const { data } = await _fetch(params);
return data
}
return { data: [], totalCount: 0 }
};
return (
<PageHeaderWrapper
......@@ -138,7 +166,7 @@ const OperationLog: React.FC = () => {
currentRef={ref}
columns={_columns}
tableProps={{ rowKey: 'id' }}
// fetchTableData={(params) => fetchdata(params)}
fetchTableData={(params) => fetchTableData(params)}
formilyLayouts={{
justify: 'space-between'
}}
......
......@@ -127,7 +127,7 @@ export const schema_3: ISchema = {
type: 'object',
'x-component': 'mega-layout',
properties: {
goodsId: {
commodityId: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
......@@ -244,7 +244,7 @@ export const schema_5: ISchema = {
type: 'object',
'x-component': 'mega-layout',
properties: {
inquiryListNo: {
inquiryListId: {
type: 'string',
'x-component': 'ModalSearch',
'x-component-props': {
......
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